Class DirectionByDirectionAngles
- Namespace
- VirtualLabAPI.Core.Numerics
- Assembly
- VirtualLabAPI.dll
A class for defining directions by direction angles.
[Serializable]
public class DirectionByDirectionAngles : DirectionDefinitionBase, IEquatable<IObjectBase>, ICloneable, ISerializable, IDeserializationCallback
- Inheritance
-
ObjectBaseSerializableObjectBaseManualSerializationDirectionByDirectionAngles
- Implements
-
IEquatable<IObjectBase>
- Inherited Members
Constructors
DirectionByDirectionAngles()
Default constructor. Sets rho and sigma to 90° and tau to 0. So the defined direction is equal to the z-axis.
public DirectionByDirectionAngles()
DirectionByDirectionAngles(double, double, double)
Constructor with all parameters
public DirectionByDirectionAngles(double rho, double sigma, double tau)
Parameters
rhodoubleAngle between x-axis and the direction to define.
sigmadoubleAngle between y-axis and the direction to define.
taudoubleAngle between z-axis and the direction to define.
DirectionByDirectionAngles(double, double, IndependentDirectionAngles, bool)
Constructor with all two independent angles and all other parameters.
public DirectionByDirectionAngles(double firstAngle, double secondAngle, IndependentDirectionAngles independentAngles, bool positiveZ)
Parameters
firstAngledoubleAngle between first axis and the direction to define.
secondAngledoubleAngle between second axis and the direction to define.
independentAnglesIndependentDirectionAnglesFlag that indicates the meaning of the parameters firstAngle and secondAngle.
positiveZboolIf
true, the z-axis will lie inside the +z half space, iffalse, inside the -z half space
DirectionByDirectionAngles(DirectionByDirectionAngles)
Copy constructor
public DirectionByDirectionAngles(DirectionByDirectionAngles orientationToCopy)
Parameters
orientationToCopyDirectionByDirectionAnglesorientation object to copy
Properties
AngleRho
Gets and sets the direction angle rho, which is the angle between the x-axis and the direction to define. The squared cosines of rho, sigma and tau have to sum to 1.
public double AngleRho { get; }
Property Value
AngleSigma
Gets and sets the direction angle sigma, which is the angle between the y-axis and the direction to define. The squared cosines of rho, sigma and tau have to sum to 1.
public double AngleSigma { get; }
Property Value
AngleTau
Gets and sets the direction angle tau, which is the angle between the z-axis and the direction to define. The squared cosines of rho, sigma and tau have to sum to 1.
public double AngleTau { get; }
Property Value
DefinitionType
Gets the DirectionDefinitionType.
public override DirectionDefinitionType DefinitionType { get; }
Property Value
IndependentAngles
Gets an information which of the three angles are independent and are used to calculate the third one
public IndependentDirectionAngles IndependentAngles { get; }
Property Value
Methods
Clone()
Creates a new object that is a copy of the current instance.
public override DirectionDefinitionBase Clone()
Returns
- DirectionDefinitionBase
A new object that is a copy of this instance.
CorrespondingVector3D()
Gets the vector resulting from the implemented direction definition.
public override Vector3D CorrespondingVector3D()
Returns
- Vector3D
The vector resulting from the implemented direction definition.
Equals(object, EqualityIntent)
Determines whether the specified object is equal to this instance. Please note: If just the resulting direction of this and the otherObject shall be compared, a comparison of CorrespondingVector3D should be done.
public override bool Equals(object otherObject, EqualityIntent equalityIntent)
Parameters
otherObjectobjectThe object to compare with this instance.
equalityIntentEqualityIntentDefines what kind of equality you want to check when comparing two objects, for example all values or physical equality.
Returns
GetThirdAngle(double, double, bool)
Method that calculates one direction angles from the two other independent angles.
public static double GetThirdAngle(double angle1, double angle2, bool negativeHalfSpaceForThirdAngle)
Parameters
angle1doubleFirst independent angle.
angle2doubleSecond independent angle.
negativeHalfSpaceForThirdAngleboolThe third angle cannot be determined uniquely from
angle1andangle2, so this flag says whether the third angle has to lie within the positive half space (false) or the negative half space (true).
Returns
- double
Third, dependent angle
SetDirectionAngles(double, double, double)
Sets the direction angles rho, sigma and tau. The squared cosines of rho, sigma and tau have to sum to 1.
public void SetDirectionAngles(double rho, double sigma, double tau)
Parameters
rhodoubleAngle between x-axis and the direction to define.
sigmadoubleAngle between y-axis and the direction to define.
taudoubleAngle between z-axis and the direction to define.
SetDirectionAngles(double, double, IndependentDirectionAngles, bool)
Sets the direction angles rho, sigma and tau. The squared cosines of rho, sigma and tau have to sum to 1.
public void SetDirectionAngles(double firstAngle, double secondAngle, IndependentDirectionAngles independentAngles, bool positiveHalfSpaceForThirdAngle)
Parameters
firstAngledoubleAngle between first axis and the direction to define.
secondAngledoubleAngle between second axis and the direction to define.
independentAnglesIndependentDirectionAnglesFlag that indicates the meaning of the parameters firstAngle and secondAngle.
positiveHalfSpaceForThirdAngleboolIf
true, the direction will lie inside the positive half space of the axis which corresponds to the third angle, iffalse, inside the negative half space. Example: if the third (i.e. the dependent angle) is tau, then the resulting direction will lie in the +z - half space in case the flag is set totrue.
ToString()
Overridden ToString method.
public override string ToString()