Show / Hide Table of Contents

Struct Angle

An angle defined in radians. The value of the angle is a double which is greater or equal to 0 and less than (and not equal) 2*pi. Via cast operators the angle seamlessly operates as a double.

Implements
System.Runtime.Serialization.ISerializable
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: CADability
Assembly: CADability.dll
Syntax
[Serializable]
public struct Angle : ISerializable

Constructors

| Improve this Doc View Source

Angle(GeoPoint2D, GeoPoint2D)

Constructs the angle

Declaration
public Angle(GeoPoint2D Target, GeoPoint2D Center)
Parameters
Type Name Description
GeoPoint2D Target
GeoPoint2D Center
| Improve this Doc View Source

Angle(GeoVector, GeoVector)

Constructs the angle that is enclosed by the two vectors (between 0 and Math.PI)

Declaration
public Angle(GeoVector v1, GeoVector v2)
Parameters
Type Name Description
GeoVector v1

First vector

GeoVector v2

Second vector

| Improve this Doc View Source

Angle(GeoVector2D)

Constructs the angle of the given vector. X-axis is 0, counterclockwise.

Declaration
public Angle(GeoVector2D v)
Parameters
Type Name Description
GeoVector2D v

vector to define the angle

| Improve this Doc View Source

Angle(GeoVector2D, GeoVector2D)

Constructs the angle that is needed to rotate the first vector counterclockwise to reach the second vector (between 0 and 2.0*Math.PI)

Declaration
public Angle(GeoVector2D v1, GeoVector2D v2)
Parameters
Type Name Description
GeoVector2D v1

First vector

GeoVector2D v2

Second vector

| Improve this Doc View Source

Angle(Double)

Constructs an angle from the provided parameter

Declaration
public Angle(double d)
Parameters
Type Name Description
System.Double d

Angle in radians

| Improve this Doc View Source

Angle(Double, Double)

Constructs an angle of a 2d vector (dx,dy)

Declaration
public Angle(double dx, double dy)
Parameters
Type Name Description
System.Double dx

x-axis difference

System.Double dy

y-axis difference

Properties

| Improve this Doc View Source

A0

Angle for 0°

Declaration
public static Angle A0 { get; }
Property Value
Type Description
Angle
| Improve this Doc View Source

A180

Angle for 180°

Declaration
public static Angle A180 { get; }
Property Value
Type Description
Angle
| Improve this Doc View Source

A270

Angle for 270°

Declaration
public static Angle A270 { get; }
Property Value
Type Description
Angle
| Improve this Doc View Source

A30

Angle for 30°

Declaration
public static Angle A30 { get; }
Property Value
Type Description
Angle
| Improve this Doc View Source

A45

Angle for 45°

Declaration
public static Angle A45 { get; }
Property Value
Type Description
Angle
| Improve this Doc View Source

A60

Angle for 60°

Declaration
public static Angle A60 { get; }
Property Value
Type Description
Angle
| Improve this Doc View Source

A90

Angle for 90°

Declaration
public static Angle A90 { get; }
Property Value
Type Description
Angle
| Improve this Doc View Source

Degree

Declaration
public double Degree { get; set; }
Property Value
Type Description
System.Double

Zugriff auf das Gradmaß

| Improve this Doc View Source

Direction

Sets the angle to the angle of the given vector. Gets a unit vector with the angle.

Declaration
public GeoVector2D Direction { get; set; }
Property Value
Type Description
GeoVector2D
| Improve this Doc View Source

Quadrant

Quadrant of the angle. Yields 0 to 3. 0: right top, 1: left top, 2: left bottom, 3: right bottom

Declaration
public int Quadrant { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Radian

Declaration
public double Radian { get; set; }
Property Value
Type Description
System.Double

Zugriff auf das Bogenmaß

Methods

| Improve this Doc View Source

Deg(Double)

Creates an angle from the provided parameter (in degrees)

Declaration
public static Angle Deg(double deg)
Parameters
Type Name Description
System.Double deg

Degrees of the angle

Returns
Type Description
Angle

The resulting angle

| Improve this Doc View Source

FromDegree(Double)

Returns an angle from the parameter interpreted as degrees

Declaration
public static Angle FromDegree(double d)
Parameters
Type Name Description
System.Double d

Degrees of the angle

Returns
Type Description
Angle

The angle

| Improve this Doc View Source

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.

| Improve this Doc View Source

IsCloseTo(Angle)

Returns true if the radians differ less than 1e-12

Declaration
public bool IsCloseTo(Angle ang)
Parameters
Type Name Description
Angle ang
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Sweeps(SweepAngle, Angle)

Liefert true, wenn der im Parameter gegebene TestWinkel von diesem Winkel ausgehend mit dem SweepAngle überstrichen wird.

Declaration
public bool Sweeps(SweepAngle sa, Angle test)
Parameters
Type Name Description
SweepAngle sa

Überstreichnung

Angle test

zu Testende Winkelposition

Returns
Type Description
System.Boolean
| Improve this Doc View Source

ToString()

Representation of this angle as a string in degrees

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.ValueType.ToString()

Operators

| Improve this Doc View Source

Addition(Angle, SweepAngle)

Adds the sweep angle to the angle

Declaration
public static Angle operator +(Angle angA, SweepAngle angB)
Parameters
Type Name Description
Angle angA

First operand

SweepAngle angB

Sweep angle to add

Returns
Type Description
Angle

The sum

| Improve this Doc View Source

Implicit(Angle to Double)

Casts an angle to a double. The radian of the angle is returned.

the angle the radian
Declaration
public static implicit operator double (Angle ang)
Parameters
Type Name Description
Angle ang
Returns
Type Description
System.Double
| Improve this Doc View Source

Implicit(SweepAngle to Angle)

Casts the sweep angle to an angle with the same value

Declaration
public static implicit operator Angle(SweepAngle sw)
Parameters
Type Name Description
SweepAngle sw
Returns
Type Description
Angle
| Improve this Doc View Source

Implicit(Double to Angle)

Casts a double to an angle. The result will be between 0 and 2*pi

double value Angle
Declaration
public static implicit operator Angle(double v)
Parameters
Type Name Description
System.Double v
Returns
Type Description
Angle
| Improve this Doc View Source

Subtraction(Angle, Angle)

Returns the sweep angle that leads from angB to angA

Declaration
public static SweepAngle operator -(Angle angA, Angle angB)
Parameters
Type Name Description
Angle angA

Target of the rotation

Angle angB

Source of the rotation

Returns
Type Description
SweepAngle

The difference

| Improve this Doc View Source

Subtraction(Angle, SweepAngle)

Returns the angle minus the provided sweep angle

Declaration
public static Angle operator -(Angle angA, SweepAngle angB)
Parameters
Type Name Description
Angle angA

first argument

SweepAngle angB

subtract this

Returns
Type Description
Angle

the difference

Implements

System.Runtime.Serialization.ISerializable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX