Documentation
¶
Index ¶
- Constants
- func ArrayMax(x []float64) (float64, bool)
- func ArrayMin(x []float64) (float64, bool)
- func ArrayRange(x []float64) (float64, bool)
- func CalcAltitude(press float64, altoffset int) (altitude float64)
- func CpuTempMonitor(updater CpuTempUpdateFunc)
- func Degrees(angle float64) float64
- func DegreesHdg(angle float64) float64
- func DegreesRel(angle float64) float64
- func DistRect(lat1, lon1, lat2, lon2 float64) (dist, bearing, distN, distE float64)
- func DistRectEast(lat1, lon1, lat2, lon2 float64) float64
- func DistRectNorth(lat1, lat2 float64) float64
- func Distance(lat1, lon1, lat2, lon2 float64) (dist, bearing float64)
- func IMax(x, y int) int
- func IMin(x, y int) int
- func IsCPUTempValid(cpuTemp float32) bool
- func IsRunningAsRoot() bool
- func LinReg(x, y []float64) (slope, intercept float64, valid bool)
- func LinRegWeighted(x, y, w []float64) (slope, intercept float64, valid bool)
- func Mean(x []float64) (float64, bool)
- func Radians(angle float64) float64
- func RadiansRel(angle float64) float64
- func RoundToInt16(in float64) (out int16)
- func Stdev(x []float64) (float64, bool)
- func TriCubeWeight(center, halfwidth, x float64) float64
- type CpuTempUpdateFunc
Constants ¶
const InvalidCpuTemp = float32(-99.0)
Variables ¶
This section is empty.
Functions ¶
func ArrayRange ¶
arrayRange calculates the range of values in array x
func CalcAltitude ¶
CalcAltitude determines the pressure altitude (feet) from the atmospheric pressure (hPa)
func CpuTempMonitor ¶
func CpuTempMonitor(updater CpuTempUpdateFunc)
func DegreesHdg ¶
degreesHdg converts angle from radians, and returns its value in the range of 0+ to 360 degrees
func DegreesRel ¶
degreesRel converts angle from radians, and returns its value in the range of -180 to +180 degrees
func DistRectEast ¶
distRectEast returns east-west distance from point 1 to point 2. Inputs are lat/lon in decimal degrees. Output is distance in meters (north positive)
func DistRectNorth ¶
distRectNorth returns north-south distance from point 1 to point 2. Inputs are lat in decimal degrees. Output is distance in meters (east positive)
func Distance ¶
distance calculates distance between two points using the law of cosines. Inputs are lat / lon of both points in decimal degrees Outputs are distance in meters and bearing to the target from origin in degrees (0° = north, 90° = east)
func IsCPUTempValid ¶
Check if CPU temperature is valid. Assume <= 0 is invalid.
func IsRunningAsRoot ¶
func IsRunningAsRoot() bool
func LinRegWeighted ¶
func RadiansRel ¶
radiansRel converts angle from degrees, and returns its value in radians in the range -Pi to + Pi
func RoundToInt16 ¶
roundToInt16 cheaply rounds a float64 to an int16, rather than truncating
func TriCubeWeight ¶
triCubeWeight returns the value of the tricube weight function at point x, for the given center and halfwidth.
Types ¶
type CpuTempUpdateFunc ¶
type CpuTempUpdateFunc func(cpuTemp float32)