Class PolarToCartesian
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.operation.transform.AbstractMathTransform
org.apache.sis.referencing.operation.transform.CoordinateSystemTransform
org.apache.sis.referencing.operation.transform.PolarToCartesian
- All Implemented Interfaces:
Serializable,Parameterized,LenientComparable,org.opengis.referencing.operation.MathTransform
Conversions from polar coordinates to two-dimensional Cartesian coordinates.
This conversion assumes that there is no datum change. Source axis order is:
- Radius (r)
- Angle (θ)
- Height (z) in the cylindrical case (see below)
- x in the direction of θ = 0°
- y in the direction of θ = 90°
- z in the same direction than the source (cylindrical case only - see below)
Normalizer in org.apache.sis.referencing.cs package.
Note:
We do not provide explicit
CylindricalToCartesian implementation. Instead, the cylindrical case is
implemented by the polar case with a PassThroughTransform for the height. This allows Apache SIS to
use the optimization implemented by PassThroughTransform when for example a concatenated transform
is dropping the z axis.- Since:
- 0.7
- Version:
- 0.7
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
AbstractMathTransform.Inverse -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final PolarToCartesianThe singleton instance expecting input coordinates in radians.private static final longFor cross-version compatibility.Fields inherited from class org.apache.sis.referencing.operation.transform.CoordinateSystemTransform
contextFields inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
MAXIMUM_BUFFER_SIZE, MAXIMUM_FAILURES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.opengis.referencing.operation.MathTransforminverse()Returns the inverse of this transform.private ObjectReturns the singleton instance on deserialization.org.opengis.referencing.operation.Matrixtransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) Converts a single coordinate and optionally computes the derivative.voidtransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Converts an array of coordinates.Methods inherited from class org.apache.sis.referencing.operation.transform.CoordinateSystemTransform
completeTransform, create, getContextualParameters, getParameterValues, getSourceDimensions, getTargetDimensions, passthroughMethods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
beforeFormat, computeHashCode, derivative, equals, equals, formatTo, getDomain, getParameterDescriptors, hashCode, isIdentity, isInverseEquals, mismatchedDimension, transform, transform, transform, transform, tryConcatenateMethods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKTMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opengis.referencing.operation.MathTransform
toWKT
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
INSTANCE
The singleton instance expecting input coordinates in radians. For the instance expecting input coordinates in degrees, useCoordinateSystemTransform.create(org.opengis.referencing.operation.MathTransformFactory, org.opengis.referencing.cs.CoordinateSystem, org.opengis.referencing.cs.CoordinateSystem, java.lang.ThreadLocal<org.opengis.referencing.operation.OperationMethod>)instead.
-
-
Constructor Details
-
PolarToCartesian
private PolarToCartesian()Creates the singleton instance. Input coordinates are in radians.
-
-
Method Details
-
readResolve
Returns the singleton instance on deserialization.- Throws:
ObjectStreamException
-
inverse
public org.opengis.referencing.operation.MathTransform inverse()Returns the inverse of this transform.- Specified by:
inversein interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
inversein classAbstractMathTransform
-
transform
public org.opengis.referencing.operation.Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) Converts a single coordinate and optionally computes the derivative.- Specified by:
transformin classAbstractMathTransform- Parameters:
srcPts- the array containing the source coordinates (cannot benull).srcOff- the offset to the point to be transformed in the source array.dstPts- the array into which the transformed coordinates is returned. May be the same thansrcPts. May benullif only the derivative matrix is desired.dstOff- the offset to the location of the transformed point that is stored in the destination array.derivate-truefor computing the derivative, orfalseif not needed.- Returns:
- the matrix of the transform derivative at the given source position,
or
nullif thederivateargument isfalse. - See Also:
-
transform
public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Converts an array of coordinates. This method performs the same conversion thantransform(double[], int, double[], int, boolean), but the formulas are repeated here for performance reasons.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
transformin classAbstractMathTransform- Parameters:
srcPts- the array containing the source point coordinates.srcOff- the offset to the first point to be transformed in the source array.dstPts- the array into which the transformed point coordinates are returned. May be the same thansrcPts.dstOff- the offset to the location of the first transformed point that is stored in the destination array.numPts- the number of point objects to be transformed.
-