UtilsConvertEllipsePhaseAngleToElevationAngle Method |
Converts the phase angle of an ellipse as used in the SP-ICE 3 API into
an elevation angle as used in Microsoft's ellipse definition.
Namespace: RAYLASE.Marker.VectorGraphicElementAssembly: RAYLASE.Marker.VectorGraphicElement (in RAYLASE.Marker.VectorGraphicElement.dll) Version: 2.19.0
Syntaxpublic static double ConvertEllipsePhaseAngleToElevationAngle(
double a,
double b,
double theta,
bool isRad
)
Parameters
- a Double
- semiaxis a of the ellipse
- b Double
- semiaxis b of the ellipse
- theta Double
- phase angle of a point on the ellipse
- isRad Boolean
- if false, the phase angle is converted into deg and the result is
returned in deg as well
Return Value
Doublethe elevation angle eta as needed by Microsoft to get the same point;
it is in the range of [0..2pi].
Remarks
a) Raylase definitions:
| P = (x, y), x=a*cos(theta), y=b*sin(theta)}
____ ---+--- *___
__--- | / ---__ theta != eta
- | /--. -_
´ | / \ ` eta counterclockwise from x axis
| |/ eta | |
-------------+---------------+----------------+-----------------
| | |
. | _. y
-__ | __- tan(eta) = -
---____ | ____--- x
---+---
| b*sin(theta) b
tan(eta) = ------------ = - tan(theta)
a*cos(theta) a
=> eta = atan(tan(theta)*b/a)
=> theta = atan(tan(eta)*a/b)
This applies for the first quadrant only. Calculated eta is positive in the first
and third quadrant, negative in the second and fourth. For the corrections
see the code.
b) Microsoft definitions:
| P
____ ---+--- *___
__--- | ---__
- | -_
´ | `
| | |
-------------+---------------+----------------+-----------------
| |\ eta | |
. | \ / _. eta clockwise from x axis
-__ | \-´ __-
---____ | \ ___---
---+--- *
| Q
See Also