Class Units
Unit conversions and utilities.
Inheritance
Inherited Members
Namespace: Elements
Assembly: Hypar.Elements.dll
Syntax
public static class Units
Fields
PI_2
Pi/2
Declaration
public const double PI_2 = 1.5707963267948966
Field Value
Type | Description |
---|---|
System.Double |
Methods
DegreesToRadians(Double)
Convert from degrees to radians
Declaration
public static double DegreesToRadians(double degrees)
Parameters
Type | Name | Description |
---|---|---|
System.Double | degrees |
Returns
Type | Description |
---|---|
System.Double | The provided value converted to radians |
FeetToFeetAndFractionalInches(Double, Int32, Double)
Convert from decimal feet to feet and fractional inches.
Declaration
public static string FeetToFeetAndFractionalInches(double decimalFeet, int roundDigits = 5, double precision = 0.015625)
Parameters
Type | Name | Description |
---|---|---|
System.Double | decimalFeet | The value to convert to a fractional inches representation. |
System.Int32 | roundDigits | The number of fractional digits in the return value. |
System.Double | precision | Fractional precision described as a double. i.e. 1/64th -> 0.015625 |
Returns
Type | Description |
---|---|
System.String |
FeetToMeters(Double)
Convert from feet to meters.
Declaration
public static double FeetToMeters(double feet)
Parameters
Type | Name | Description |
---|---|---|
System.Double | feet |
Returns
Type | Description |
---|---|
System.Double | The provided value converted to meters. |
GetConversionToMeters(Units.LengthUnit)
Get the conversion factor from the provided length unit to meters.
Declaration
public static double GetConversionToMeters(Units.LengthUnit from)
Parameters
Type | Name | Description |
---|---|---|
Units.LengthUnit | from | The length unit. |
Returns
Type | Description |
---|---|
System.Double |
InchesToFractionalInches(Double, Int32, Double)
Convert from decimal inches to fractional inches
Declaration
public static string InchesToFractionalInches(double decimalInches, int roundDigits = 5, double precision = 0.015625)
Parameters
Type | Name | Description |
---|---|---|
System.Double | decimalInches | The value to convert to a fractional inches representation. |
System.Int32 | roundDigits | The number of fractional digits in the return value. |
System.Double | precision | Fractional precision described as a double. i.e. 1/64th -> 0.015625 |
Returns
Type | Description |
---|---|
System.String |
InchesToMeters(Double)
Convert from inches to meters.
Declaration
public static double InchesToMeters(double inches)
Parameters
Type | Name | Description |
---|---|---|
System.Double | inches | A value of inches. |
Returns
Type | Description |
---|---|
System.Double | The provided value converted to meters. |
MetersToFeet(Double)
Convert from meters to feet.
Declaration
public static double MetersToFeet(double meters)
Parameters
Type | Name | Description |
---|---|---|
System.Double | meters |
Returns
Type | Description |
---|---|
System.Double | The provided value converted to feet. |
MetersToInches(Double)
Convert from meters to inches.
Declaration
public static double MetersToInches(double meters)
Parameters
Type | Name | Description |
---|---|---|
System.Double | meters |
Returns
Type | Description |
---|---|
System.Double | The provided value converted to inches. |
RadiansToDegrees(Double)
Convert from radians to degrees.
Declaration
public static double RadiansToDegrees(double radians)
Parameters
Type | Name | Description |
---|---|---|
System.Double | radians |
Returns
Type | Description |
---|---|
System.Double | The provided value converted to radians. |