Code Search for Developers
 
 
  

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

GridBlocks

GridBlocks builds a grid application framework via easy-to-use building blocks in distributed environment. The framework offers components for Grid security, distributed storage, computing, and Portlet web interfaces.

Project homepage: http://sourceforge.net/projects/gridblocks
Programming language(s): Java,JSP,XML
License: other

  GridReferenceConverter.java
  ReferenceEllipsoid.java
  ReferenceEllipsoids.java
  UTMReference.java