Struct SweepAngle
A sweep angle. Typically the value of this object is between -2pi and +2pi. Used for rotation operations etc.
Implements
Inherited Members
Namespace: CADability
Assembly: CADability.dll
Syntax
[Serializable]
public struct SweepAngle : ISerializable
Constructors
| Improve this Doc View SourceSweepAngle(Angle, Angle, Boolean)
Constructs the sweep angle you need to go from From to To in the
direction defined by CounterClockwise
Declaration
public SweepAngle(Angle From, Angle To, bool CounterClockwise)
Parameters
| Type | Name | Description |
|---|---|---|
| Angle | From | starting angle |
| Angle | To | ending angle |
| System.Boolean | CounterClockwise | direction |
SweepAngle(GeoPoint2D, GeoPoint2D)
Constructs the sweep angle as the angle of the vector from Center to Target
Declaration
public SweepAngle(GeoPoint2D Target, GeoPoint2D Center)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoPoint2D | Target | Endpoint of the vector |
| GeoPoint2D | Center | Startpoint of the vector |
SweepAngle(GeoVector, GeoVector)
Constructs the sweep angle you need to go from From to To.
Declaration
public SweepAngle(GeoVector From, GeoVector To)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoVector | From | starting vector |
| GeoVector | To | target vector |
SweepAngle(GeoVector2D, GeoVector2D)
Constructs a sweep angle from the vector From to the vector To.
Declaration
public SweepAngle(GeoVector2D From, GeoVector2D To)
Parameters
| Type | Name | Description |
|---|---|---|
| GeoVector2D | From | |
| GeoVector2D | To |
SweepAngle(Double)
Constructs the sweep angle with the provided radian (which must be between -2pi and +2pi, which is not checked)
Declaration
public SweepAngle(double d)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | d |
SweepAngle(Double, Double)
Constructs the sweep angle with tan(sweep angle)==dy/dx
Declaration
public SweepAngle(double dx, double dy)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | dx | |
| System.Double | dy |
Fields
| Improve this Doc View SourceFull
The sweep angle that turns 360° counterclockwise
Declaration
public static SweepAngle Full
Field Value
| Type | Description |
|---|---|
| SweepAngle |
FullReverse
The sweep angle that turns 360° clockwise
Declaration
public static SweepAngle FullReverse
Field Value
| Type | Description |
|---|---|
| SweepAngle |
Opposite
The sweep angle that turns to the opposite directio
Declaration
public static SweepAngle Opposite
Field Value
| Type | Description |
|---|---|
| SweepAngle |
ToLeft
The sweep angle that turns 90° to the left
Declaration
public static SweepAngle ToLeft
Field Value
| Type | Description |
|---|---|
| SweepAngle |
ToRight
The sweep angle that turns 90° to the right
Declaration
public static SweepAngle ToRight
Field Value
| Type | Description |
|---|---|
| SweepAngle |
Properties
| Improve this Doc View SourceDegree
Declaration
public double Degree { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | Zugriff auf das Gradmaß |
Radian
Declaration
public double Radian { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | Zugriff auf das Bogenmaß |
Methods
| Improve this Doc View SourceDeg(Double)
Returns a SweepAngle that rotates by the given degrees
Declaration
public static SweepAngle Deg(double d)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | d | amount to rotate in degrees (-360<=d<=360) |
Returns
| Type | Description |
|---|---|
| SweepAngle | A new SweepAngle |
GetObjectData(SerializationInfo, StreamingContext)
Implements System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
Declaration
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | The System.Runtime.Serialization.SerializationInfo to populate with data. |
| System.Runtime.Serialization.StreamingContext | context | The destination (System.Runtime.Serialization.StreamingContext) for this serialization. |
IsCloseTo(SweepAngle)
Returns true, if the sweep angles differ by less than 1e-12 (in radian)
Declaration
public bool IsCloseTo(SweepAngle ang)
Parameters
| Type | Name | Description |
|---|---|---|
| SweepAngle | ang |
Returns
| Type | Description |
|---|---|
| System.Boolean |
ToString()
Returns a string representation of this sweep angle in degrees
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String |
Overrides
Operators
| Improve this Doc View SourceImplicit(Angle to SweepAngle)
Casts an angle to a sweep angle with the same value
Declaration
public static implicit operator SweepAngle(Angle a)
Parameters
| Type | Name | Description |
|---|---|---|
| Angle | a |
Returns
| Type | Description |
|---|---|
| SweepAngle |
Implicit(SweepAngle to Double)
Cast Operator, der einen Winkel in ein double umwandelt. Ergebnis ist das Bogenmaß des Winkels. Es werden keine Berechnungen vorgenommen
Declaration
public static implicit operator double (SweepAngle ang)
Parameters
| Type | Name | Description |
|---|---|---|
| SweepAngle | ang | der Winkel |
Returns
| Type | Description |
|---|---|
| System.Double | double als Ergebnis |
Implicit(Double to SweepAngle)
Cast Operator, der ein double in einen Winkel umwandelt. Es wird das modulo 2*pi berechnet
Declaration
public static implicit operator SweepAngle(double v)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | v | double Wert |
Returns
| Type | Description |
|---|---|
| SweepAngle | Winkel |
Multiply(Double, SweepAngle)
Returns the multiple of the sweep angle
Declaration
public static SweepAngle operator *(double d, SweepAngle s)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | d | factor |
| SweepAngle | s |
Returns
| Type | Description |
|---|---|
| SweepAngle |
UnaryNegation(SweepAngle)
Returns the reverse of the provided sweep angle
Declaration
public static SweepAngle operator -(SweepAngle s)
Parameters
| Type | Name | Description |
|---|---|---|
| SweepAngle | s |
Returns
| Type | Description |
|---|---|
| SweepAngle |