org.orekit.utils
Class Line

java.lang.Object
  extended by org.orekit.utils.Line

public class Line
extends java.lang.Object

The class represent lines in a three dimensional space.

Each oriented line is intrinsically associated with an abscissa wich is a coordinate on the line. The point at abscissa 0 is the orthogonal projection of the origin on the line, another equivalent way to express this is to say that it is the point of the line which is closest to the origin. Abscissa increases in the line direction.

This class is a simplification of the org.spaceroots.lift.geometry.threeD.Line class from the Lift library written and owned by Luc Maisonobe. It is reused here with permission, as CS has a source and redistribution licence for it.

Version:
$Revision:1665 $ $Date:2008-06-11 12:12:59 +0200 (mer., 11 juin 2008) $
Author:
Luc Maisonobe

Constructor Summary
Line(org.apache.commons.math.geometry.Vector3D p, org.apache.commons.math.geometry.Vector3D direction)
          Build a line from a point and a direction.
 
Method Summary
 boolean contains(org.apache.commons.math.geometry.Vector3D p)
          Check if the instance contains a point.
 double distance(org.apache.commons.math.geometry.Vector3D p)
          Compute the distance between the instance and a point.
 double getAbscissa(org.apache.commons.math.geometry.Vector3D point)
          Get the abscissa of a point with respect to the line.
 org.apache.commons.math.geometry.Vector3D getDirection()
          Get the normalized direction vector.
 org.apache.commons.math.geometry.Vector3D getOrigin()
          Get the line point closest to the origin.
 org.apache.commons.math.geometry.Vector3D pointAt(double abscissa)
          Get one point from the line.
static Line revert(Line line)
          Revert the line direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Line

public Line(org.apache.commons.math.geometry.Vector3D p,
            org.apache.commons.math.geometry.Vector3D direction)
Build a line from a point and a direction.

Parameters:
p - point belonging to the line (this can be any point)
direction - direction of the line
Throws:
java.lang.IllegalArgumentException - if the direction norm is too small
Method Detail

revert

public static Line revert(Line line)
Revert the line direction.

Parameters:
line - the line to revert
Returns:
a new instance of Line which is the reverse of line

getDirection

public org.apache.commons.math.geometry.Vector3D getDirection()
Get the normalized direction vector.

Returns:
normalized direction vector

getOrigin

public org.apache.commons.math.geometry.Vector3D getOrigin()
Get the line point closest to the origin.

Returns:
line point closest to the origin

getAbscissa

public double getAbscissa(org.apache.commons.math.geometry.Vector3D point)
Get the abscissa of a point with respect to the line.

The abscissa is 0 if the projection of the point and the projection of the frame origin on the line are the same point.

Parameters:
point - point to check
Returns:
abscissa of the point

pointAt

public org.apache.commons.math.geometry.Vector3D pointAt(double abscissa)
Get one point from the line.

Parameters:
abscissa - desired abscissa for the point
Returns:
one point belonging to the line, at specified abscissa (really a Vector3D instance)

contains

public boolean contains(org.apache.commons.math.geometry.Vector3D p)
Check if the instance contains a point.

Parameters:
p - point to check
Returns:
true if p belongs to the line

distance

public double distance(org.apache.commons.math.geometry.Vector3D p)
Compute the distance between the instance and a point.

Parameters:
p - to check
Returns:
distance between the instance and the point


Copyright © 2002-2010 CS Communication & Systèmes. All Rights Reserved.