Class Kit
The stateless helpers from the pamoja kit.
public static class Kit
- Inheritance
-
Kit
- Inherited Members
Remarks
The stateful helpers are their own types (Smoother, Pid, Thermostat and the rest); what remains here is the arithmetic that needs no memory of previous calls.
Methods
BearingBetween(Coordinate, Coordinate)
Returns the initial bearing from one coordinate to another.
public static double BearingBetween(Coordinate origin, Coordinate destination)
Parameters
originCoordinateThe coordinate to measure from.
destinationCoordinateThe coordinate to measure to.
Returns
- double
The bearing in degrees, clockwise from north.
Deadband(float, float, float)
Suppresses movement within a band, so noise does not act.
public static float Deadband(float value, float center, float width)
Parameters
valuefloatThe latest reading.
centerfloatThe value the band sits around.
widthfloatThe full width of the band.
Returns
- float
centerwhile the reading is inside the band, and otherwise the reading shifted toward the centre by half the band width, so the output is continuous.
DistanceBetween(Coordinate, Coordinate)
Returns the great-circle distance between two coordinates.
public static double DistanceBetween(Coordinate origin, Coordinate destination)
Parameters
originCoordinateThe coordinate to measure from.
destinationCoordinateThe coordinate to measure to.
Returns
- double
The distance in metres.