﻿MathUtil Class

# MathUtil Class

Get information about the latest release
A collection of useful math functions.
Inheritance Hierarchy
SystemObject
Telogis.GeoBaseMathUtil

Namespace:  Telogis.GeoBase
Assembly:  geobase.net (in geobase.net.dll) Version: 4.96.0.0
Syntax
`public class MathUtil`

The MathUtil type exposes the following members.

Constructors
NameDescription
MathUtil
Initializes a new instance of the MathUtil class
Top
Methods
NameDescription
AcosSafe
Calculate the arc-cosine (Acos) in radians with out-of-bounds check: if input > 1 use 1; if input < -1 use -1 as input.
Clamp(Double, Double, Double)
The closest value to a specified double that falls within a specified range.
Clamp(Int32, Int32, Int32)
The closest value to a specified integer that falls within a specified range.
ClampT(T, T, T)
Limits a value to a range.
ClosestPoint
Calculates the closest point on the line AB to the point given.
ClosestPointInPointCloud
Returns the point in the list which is closest to the query. Does not treat list as line.
ConvertUnits(Double, DistanceUnit, DistanceUnit)
Converts a distance from one distance unit to another.
ConvertUnits(Double, MassUnit, MassUnit)
Converts between two mass units.
ConvertUnits(Double, SpeedUnit, SpeedUnit)
Converts between two speed units.
ConvertUnits(Double, TimeUnit, TimeUnit)
Converts between two time units.
ConvertUnitsInt
Convert a value from one distance unit to another, returning a rounded int result.
Distance(IListLatLon, Int32, LatLon)
Returns the length (measured in radians) to the line segment of the 'points' array that lies closest to 'p'.
Distance(IListLatLon, Int32, Int32, Int32, LatLon)
Calculates the segment in the 'points' array that lies closest to 'p'.
DistanceFromPointToLine
The great circle distance from a point to a line lineStart->lineEnd in the given units.
DistToUnits
Convert from radians to a given Unit.
EditDistance(String, String)
Gets the Levenshtein edit distance between two strings.
EditDistance(String, String, MathUtilEditDistanceOptions)
Gets the Levenshtein or Damerau-Levenshtein edit distance between two strings.
Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
GetHashCode
Serves as the default hash function.
(Inherited from Object.)
GetType
Gets the Type of the current instance.
(Inherited from Object.)
GreatCircle
Calculate the distance (in radians) between 2 latitude/longitude pairs over the surface of a sphere.
Calculate the difference between two headings.
Interpolate
Interpolate between two points.
IsDaytime
Indicates whether a specified date time falls between sunrise and sunset at a specified location.
KilogramsToUnits
Converts a given number of kilograms to its MassUnit equivalent.
LatLonToEPSG3395
Convert from a LatLon point to x and y in EPSG:3395 co-ordinate space.
LatLonToEPSG3857
Convert from a LatLon point to x and y in EPSG:3857 co-ordinate space.
MaxT
Returns the maximum of one or more values.
MinT
Returns the minimum of one or more values.
Given a starting position, a movement direction (as a bearing) and a distance, calculate the end position.
NearlyEqual
Returns a boolean value that states whether or not two float values are equal within a certain tolerance.
PythagoreanClosestPointOnLine(LatLon, LatLon, LatLon) Obsolete.
PythagoreanClosestPointOnLine(LatLon, LatLon, LatLon, Double) Obsolete.
PythagoreanDistanceFromPointToLine Obsolete.
QuickClosestPointOnLine(LatLon, LatLon, LatLon)
Calculates the closest point on the line lineStart->lineEnd to the point given.
QuickClosestPointOnLine(LatLon, LatLon, LatLon, Double)
Calculates the closest point on the line lineStart->lineEnd to the point given using a Pythagorean approximation.
QuickDistanceFromPointToLine
Distance from point to line start->end using a Pythagorean approximation.
RoundToIncrement
Returns a double value rounded to a specified increment. e.g. RoundToIncrement(23, 5) returns 25, RountToIncrement(23, 10) returns 20.
RoundToSignificantFigures
Returns a double value rounded to a specified number of significant figures.
SpeedToUnits
Converts a given speed from radians per second into the specified unit.
TimeToUnits
Converts a given quantity of seconds to its TimeUnit equivalent. Thrown when the output_type TimeUnit is not recognized.
ToDegrees
ToString
Returns a string that represents the current object.
(Inherited from Object.)
Truncate
Truncates a double value, removing any fractional digits.
UnitsToKilograms
Converts a given mass unit to kilograms.
Convert a distance value from given units into radians.
Converts a given speed unit to radians per second.
UnitsToSeconds
Converts a given quantity of TimeUnits to its seconds equivalent.
Top
Fields
NameDescription
METERS_PER_NM
The number of meters in one international nautical mile.
MILES_PER_NM
The number of statute miles in one international nautical mile.
NM_PER_DEGREES
The number of international nautical miles in one degree along the Equator. 1 international nautical mile equals 1852m or 0.998383 equatorial arc minutes. Thus 1 equatorial arc degree equals 60.097177 international nautical miles. This differs from the geographical mile or historical nautical mile, which equal 1 arc minute along the equator or the meridian respectively.
POUNDS_PER_KG
The number of avoirdupois pounds in a kilogram.
Top