ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Geometry Namespace / AngularUnit Class / CreateAngularUnit Method / CreateAngularUnit(String,Double) Method
Name for the angular unit.
Conversion factor. Radians per unit.
Example

In This Topic
    CreateAngularUnit(String,Double) Method
    In This Topic
    Convenience method to quickly create a custom AngularUnit instance.
    Syntax
    public static AngularUnit CreateAngularUnit( 
       string name,
       double conversionFactor
    )
    Public Overloads Shared Function CreateAngularUnit( _
       ByVal name As String, _
       ByVal conversionFactor As Double _
    ) As AngularUnit

    Parameters

    name
    Name for the angular unit.
    conversionFactor
    Conversion factor. Radians per unit.

    Return Value

    Example
    AngularUnit - Create a Custom AngularUnit
    // custom unit - 3 radians per unit
    var myAngularUnit = AngularUnit.CreateAngularUnit("myCustomAngularUnit", 3);
    string Name = myAngularUnit.Name;                   // myCustomAngularUnit
    double Factor = myAngularUnit.ConversionFactor;     // 3
    int Code = myAngularUnit.FactoryCode;               // 0 because it is a custom angular unit
    double radiansUnit = myAngularUnit.RadiansPerUnit;  // 3
    
    // convert 10 degrees to my unit
    double converted = AngularUnit.Degrees.ConvertTo(10, myAngularUnit);
    // convert it back to degrees
    converted = myAngularUnit.ConvertTo(converted, AngularUnit.Degrees);
    
    // convert 1 radian into my angular units
    converted = myAngularUnit.ConvertFromRadians(1);
    
    // get the wkt
    string wkt = myAngularUnit.Wkt;
    
    // create an angular unit from this wkt
    var anotherAngularUnit = AngularUnit.CreateAngularUnit(wkt);
    // anotherAngularUnit.ConversionFactor = 3
    // anotherAngularUnit.FactoryCode = 0    
    // anotherAngularUnit.RadiansPerUnit = 3
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also