C# Class CSharpRoboticsLib.Utility.Util

Provides various mathematical and logical utility functions
Show file Open project: shockwave4488/CSharpRoboticsLib

Public Methods

Method Description
AccurateWaitMilliseconds ( double time ) : void

Waits for a specified time more accurately than Thread.Sleep()

AccurateWaitSeconds ( double time ) : void

Waits for a specified time more accurately than Thread.Sleep()

Limit ( double value, double low, double high ) : double

Limits the value to a low and high threshold

ToDegrees ( double radians ) : double

Converts radians to degrees

ToRadians ( double degrees ) : double

Converts degrees to radians

WrapDegrees ( double degrees ) : double

Wraps degrees around -180 to 180

WrapError ( double value, double setpoint, double min, double max ) : double

Wraps an error value around a maximum and minimum input.

WrapRadians ( double radians ) : double

Wraos radians around -PI and PI

Method Details

AccurateWaitMilliseconds() public static method

Waits for a specified time more accurately than Thread.Sleep()
public static AccurateWaitMilliseconds ( double time ) : void
time double Time in milliseconds to wait
return void

AccurateWaitSeconds() public static method

Waits for a specified time more accurately than Thread.Sleep()
public static AccurateWaitSeconds ( double time ) : void
time double Time in seconds to wait
return void

Limit() public static method

Limits the value to a low and high threshold
public static Limit ( double value, double low, double high ) : double
value double value to be limited
low double lower limit
high double upper limit
return double

ToDegrees() public static method

Converts radians to degrees
public static ToDegrees ( double radians ) : double
radians double angle in radians
return double

ToRadians() public static method

Converts degrees to radians
public static ToRadians ( double degrees ) : double
degrees double angle in degrees
return double

WrapDegrees() public static method

Wraps degrees around -180 to 180
public static WrapDegrees ( double degrees ) : double
degrees double
return double

WrapError() public static method

Wraps an error value around a maximum and minimum input.
public static WrapError ( double value, double setpoint, double min, double max ) : double
value double
setpoint double
min double
max double
return double

WrapRadians() public static method

Wraos radians around -PI and PI
public static WrapRadians ( double radians ) : double
radians double
return double