ReferenceEllipsoid.java from GridBlocks at Krugle
Show ReferenceEllipsoid.java syntax highlighted
//-----------------------------------------------------------------------------
// ReferenceEllipsoid.java
//
// (c) 2004 Jonathan Stott
//
// Created on 02-Mar-2004
//
// 0.2 - 02 Mar 2004
// - Initial version
//-----------------------------------------------------------------------------
package fi.hip.gb.bluetooth.coordconv;
/**
* A class to represent a reference ellipsoid
*
* @author Jonathan Stott
* @version 0.2
* @since 0.2
*/
public class ReferenceEllipsoid {
private String name = "";
private double semiMajorAxis = 0.0;
private double semiMinorAxis = 0.0;
private double eccentricitySquared = 0.0;
/**
* Create a new reference ellipsoid from the semi-major (equatorial radius)
* and semi-minor axes. The semi-minor axis of the ellipsoid can be calculated
* from the eccentricity squared (e<sup>2</sup>) and the semi-major axis
* (a<sup>2</sup>) by finding sqrt(-e<sup>2</sup>a<sup>2</sup> + a<sup>2</sup>)
*
* @param inName the name of the reference ellipsoid
* @param inSemiMajorAxis
* @param inSemiMinorAxis
*/
public ReferenceEllipsoid(String inName,
double inSemiMajorAxis,
double inSemiMinorAxis) {
name = inName;
semiMajorAxis = inSemiMajorAxis;
semiMinorAxis = inSemiMinorAxis;
eccentricitySquared =
((semiMajorAxis * semiMajorAxis) - (semiMinorAxis * semiMinorAxis))
/ (semiMajorAxis * semiMajorAxis);
}
/**
* Get the semi-minor axis of the reference ellipsoid
*
* @return
*/
public double getSemiMinorAxis() {
return semiMinorAxis;
}
/**
* Get the eccentricity squared of the reference ellipsoid
*
* @return
*/
public double getEccentricitySquared() {
return eccentricitySquared;
}
/**
* Get the semi-major axis (equatorial radius) of the reference ellipsoid
*
* @return
*/
public double getSemiMajorAxis() {
return semiMajorAxis;
}
/**
* Get the equatorial radius (semi-major axis) of the reference ellipsoid
*
* @return
*/
public double getEquatorialRadius() {
return semiMajorAxis;
}
/**
* Get the name of the reference ellipsoid
*
* @return
*/
public String getName() {
return name;
}
}
See more files for this project here