RhinoMath Class

RhinoMath Class

Provides constants and static methods that are additional to Math.
Inheritance Hierarchy
SystemObject
  RhinoRhinoMath

Namespace:  Rhino
Assembly:  RhinoCommon (in RhinoCommon.dll)
Syntax
public static class RhinoMath
Public NotInheritable Class RhinoMath

The RhinoMath type exposes the following members.

Methods
  NameDescription
Public methodStatic memberClamp(Double, Double, Double)
Restricts a Double to be specified within an interval of two numbers.
Public methodStatic memberClamp(Int32, Int32, Int32)
Restricts a Int32 to be specified within an interval of two integers.
Public methodStatic memberCRC32(UInt32, Byte)
Advances the cyclic redundancy check value remainder given a byte array. http://en.wikipedia.org/wiki/Cyclic_redundancy_check.
Public methodStatic memberCode exampleCRC32(UInt32, Double)
Advances the cyclic redundancy check value remainder given a Double. http://en.wikipedia.org/wiki/Cyclic_redundancy_check.
Public methodStatic memberCRC32(UInt32, Int32)
Advances the cyclic redundancy check value remainder given a Int32. http://en.wikipedia.org/wiki/Cyclic_redundancy_check.
Public methodStatic memberEpsilonEquals(Double, Double, Double)
Compare two doubles for equality within some "epsilon" range
Public methodStatic memberEpsilonEquals(Single, Single, Single)
Compare to floats for equality within some "epsilon" range
Public methodStatic memberIntIndexToString
Portrays an Int32 index in text.
Public methodStatic memberIsValidDouble
Determines whether a Double value is valid within the RhinoCommon context.

Rhino does not use Double.NaN by convention, so this test evaluates to true if:

x is not equal to RhinoMath.UnsetValue

System.Double.IsNaN(x) evaluates to false

System.Double.IsInfinity(x) evaluates to false

Public methodStatic memberIsValidSingle
Determines whether a Single value is valid within the RhinoCommon context.

Rhino does not use Single.NaN by convention, so this test evaluates to true if:

x is not equal to RhinoMath.UnsetValue,

System.Single.IsNaN(x) evaluates to false

System.Single.IsInfinity(x) evaluates to false

Public methodStatic memberParseNumber
Evaluates command line math expression.
Public methodStatic memberToDegrees
Convert an angle from radians to degrees.
Public methodStatic memberToRadians
Convert an angle from degrees to radians.
Public methodStatic memberTryParseNumber
Evaluates command line math expression.
Public methodStatic memberUnitScale
Computes the scale factor for changing the measurements unit systems.
Top
Fields
  NameDescription
Public fieldStatic memberDefaultAngleTolerance
Represents the default angle tolerance, used when no other values are provided.

This is one degree, expressed in radians.

Public fieldStatic memberSqrtEpsilon
Represents a default value that is used when comparing square roots.

This value is several orders of magnitude larger than ZeroTolerance.

Public fieldStatic memberUnsetIntIndex
When signed int values are used in a context where 0 and small negative values are valid indices and there needs to be a value that indicates the index is not set, OpenNURBS uses this index. This value is -2147483647, or Int32.MinValue + 1. This value paralles ON_UNSET_INT_INDEX.
Public fieldStatic memberUnsetSingle
Gets the single precision floating point number that is considered 'unset' in Rhino.
Public fieldStatic memberUnsetValue
Gets the Rhino standard Unset value. Use this value rather than Double.NaN when a bogus floating point value is required.
Public fieldStatic memberZeroTolerance
Gets the Zero Tolerance constant (1.0e-12).
Top
Version Information

Rhino for Mac

Supported in: 5.4

Rhino for Windows

Supported in: 6.8
See Also