Package uk.ac.starlink.ttools.plot2.geom
Class SinProjection
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.geom.SkyviewProjection
-
- uk.ac.starlink.ttools.plot2.geom.SinProjection
-
- All Implemented Interfaces:
Projection
public class SinProjection extends SkyviewProjection
Sine (orthographic) projection. This is the one that gives you a rotatable sphere. North always faces directly up (is aligned along the screen Y direction). This is a singleton class, seeINSTANCE
.- Since:
- 21 Feb 2013
- Author:
- Mark Taylor
-
-
Field Summary
Fields Modifier and Type Field Description static SinProjection
INSTANCE
Singleton instance.-
Fields inherited from class uk.ac.starlink.ttools.plot2.geom.SkyviewProjection
AIT, CAR1, TAN
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SkyAspect
createAspect(boolean reflect, double[] r3, double radiusRad, Range[] vxyzRanges)
Creates a SkyAspect from configuration information.double[]
cursorRotate(double[] rot0, java.awt.geom.Point2D.Double pos0, java.awt.geom.Point2D.Double pos1)
Returns null - rotation not implemented.SkyFov
getFov(SkySurface surf)
Returns the field of view represented by this aspect.java.lang.String
getProjectionDescription()
Returns a short description of the projection.java.lang.String
getProjectionName()
Returns the projection name.boolean
project(double rx, double ry, double rz, java.awt.geom.Point2D.Double pos)
Overridden for slight efficiency gain.double[]
projRotate(double[] rot0, java.awt.geom.Point2D.Double pos0, java.awt.geom.Point2D.Double pos1)
Returns null - rotation not implemented.boolean
useRanges(boolean reflect, double[] r3, double radiusRad)
Returns false - ranging not used.static double[]
verticalRotate(double delta, double alpha, boolean reflect)
Rotation matrix which results in an orientation with the viewing plane X coordinate of the north pole equal to zero.-
Methods inherited from class uk.ac.starlink.ttools.plot2.geom.SkyviewProjection
createProjection, getProjectionShape, getSkyviewProjecter, isContinuous, unproject
-
-
-
-
Field Detail
-
INSTANCE
public static SinProjection INSTANCE
Singleton instance.
-
-
Method Detail
-
getProjectionName
public java.lang.String getProjectionName()
Description copied from interface:Projection
Returns the projection name.- Specified by:
getProjectionName
in interfaceProjection
- Overrides:
getProjectionName
in classSkyviewProjection
- Returns:
- user-directed projection name
-
getProjectionDescription
public java.lang.String getProjectionDescription()
Description copied from interface:Projection
Returns a short description of the projection. return projection description- Specified by:
getProjectionDescription
in interfaceProjection
- Overrides:
getProjectionDescription
in classSkyviewProjection
-
project
public boolean project(double rx, double ry, double rz, java.awt.geom.Point2D.Double pos)
Overridden for slight efficiency gain.- Specified by:
project
in interfaceProjection
- Overrides:
project
in classSkyviewProjection
- Parameters:
rx
- normalised 3D X coordinatery
- normalised 3D Y coordinaterz
- normalised 3D Z coordinatepos
- point object into which projected dimensionless X,Y coordinates will be written on success- Returns:
- true if transformation succeeded
-
cursorRotate
public double[] cursorRotate(double[] rot0, java.awt.geom.Point2D.Double pos0, java.awt.geom.Point2D.Double pos1)
Description copied from class:SkyviewProjection
Returns null - rotation not implemented.- Specified by:
cursorRotate
in interfaceProjection
- Overrides:
cursorRotate
in classSkyviewProjection
- Parameters:
rot0
- initial rotation matrixpos0
- initial cursor positionpos1
- destination cursor position- Returns:
- destination rotation matrix, or null
-
projRotate
public double[] projRotate(double[] rot0, java.awt.geom.Point2D.Double pos0, java.awt.geom.Point2D.Double pos1)
Description copied from class:SkyviewProjection
Returns null - rotation not implemented.- Specified by:
projRotate
in interfaceProjection
- Overrides:
projRotate
in classSkyviewProjection
- Parameters:
rot0
- initial rotation matrixpos0
- initial projected positionpos1
- destination projected position- Returns:
- destination rotation matrix, or null
-
useRanges
public boolean useRanges(boolean reflect, double[] r3, double radiusRad)
Description copied from class:SkyviewProjection
Returns false - ranging not used.- Specified by:
useRanges
in interfaceProjection
- Overrides:
useRanges
in classSkyviewProjection
- Parameters:
reflect
- whether requested aspect will be reflectedr3
- central position of field of view (may be null)radiusRad
- radius of field of view (may be NaN)- Returns:
- true if ranges would be useful given the other arguments
- See Also:
SurfaceFactory.readRanges(P, uk.ac.starlink.ttools.plot2.PlotLayer[], uk.ac.starlink.ttools.plot2.data.DataStore)
-
createAspect
public SkyAspect createAspect(boolean reflect, double[] r3, double radiusRad, Range[] vxyzRanges)
Description copied from interface:Projection
Creates a SkyAspect from configuration information. Either the supplied field of view or data ranges may be used, or neither.- Specified by:
createAspect
in interfaceProjection
- Overrides:
createAspect
in classSkyviewProjection
- Parameters:
reflect
- whether requested aspect will be reflectedr3
- central position of field of view (may be null)radiusRad
- radius of field of view (may be NaN)vxyzRanges
- definite ranges for normalised X,Y,Z coordinates acquired from data- Returns:
- new sky aspect
- See Also:
SurfaceFactory.createAspect(P, uk.ac.starlink.ttools.plot2.config.ConfigMap, uk.ac.starlink.ttools.plot.Range[])
-
getFov
public SkyFov getFov(SkySurface surf)
Description copied from interface:Projection
Returns the field of view represented by this aspect. This is a best estimate, it may be approximate depending on the projection geometry. If the field of view is the default for this projection, then null should be returned. Null may also be returned if for some reason no field of view can be determined.- Specified by:
getFov
in interfaceProjection
- Overrides:
getFov
in classSkyviewProjection
- Parameters:
surf
- sky surface, which must be set up using this projection- Returns:
- field of view, or null
-
verticalRotate
public static double[] verticalRotate(double delta, double alpha, boolean reflect)
Rotation matrix which results in an orientation with the viewing plane X coordinate of the north pole equal to zero. This is a rotation invariant we wish to preserve.- Parameters:
delta
- rotation of pole from vertical (0..pi)alpha
- rotation around pole (0..2pi)reflect
- if true, alpha increases right to left- Returns:
- rotation matrix
-
-