Package uk.ac.starlink.ttools.plot2.geom
Class SphereNet
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.geom.SphereNet
-
public class SphereNet extends java.lang.Object
Calculates line segments forming longitude and latitude lines for a sphere around the data origin of a cube surface.- Since:
- 15 Aug 2018
- Author:
- Mark Taylor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SphereNet.Line3d
Represents a set of 3-d points that can be joined together to make a grid line.
-
Constructor Summary
Constructors Constructor Description SphereNet(CubeSurface surf)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getDefaultRadius()
Returns a reasonable radius for the sphere if none is explicitly specified.SphereNet.Line3d[]
getLatitudeLines(double dRadius, int nLat)
Returns an array of line specifications representing lines of latitude.SphereNet.Line3d[]
getLongitudeLines(double dRadius, int nLon)
Returns an array of line specifications representing lines of longitude.
-
-
-
Constructor Detail
-
SphereNet
public SphereNet(CubeSurface surf)
Constructor.- Parameters:
surf
- surface on which grid lines will be specified
-
-
Method Detail
-
getDefaultRadius
public double getDefaultRadius()
Returns a reasonable radius for the sphere if none is explicitly specified. The general idea is to have something that will be visible. If the data origin is within the visible region, then the largest sphere that will fit is used, otherwise it's a sphere for which at least part of the surface appears in the visible region.- Returns:
- reasonable radius for sphere in data units
-
getLongitudeLines
public SphereNet.Line3d[] getLongitudeLines(double dRadius, int nLon)
Returns an array of line specifications representing lines of longitude.- Parameters:
dRadius
- radius in data unitsnLon
- number of equally spaced great circles required; note this is half the number of meridians- Returns:
nLon
-element array of meridian specifiers
-
getLatitudeLines
public SphereNet.Line3d[] getLatitudeLines(double dRadius, int nLat)
Returns an array of line specifications representing lines of latitude.- Parameters:
dRadius
- radius in data unitsnLat
- number of equally spaced latitude lines in the north (or south) hemisphere; excludes the equator- Returns:
1+nLat*2
-element aray of parallel specifiers
-
-