org.apache.commons.math3.geometry.euclidean.threed
Class InfiniteRectangleCone

java.lang.Object
  extended by org.apache.commons.math3.geometry.euclidean.threed.InfiniteRectangleCone
All Implemented Interfaces:
Serializable, InfiniteCone, InfiniteShape, Shape

public final class InfiniteRectangleCone
extends Object
implements InfiniteCone, Serializable

This is a describing class for a 3D infinite cone, with some algorithm to compute intersections and distances to some other objects.

Since:
1.0
Version:
$Id: InfiniteRectangleCone.java 16755 2016-10-07 15:47:40Z bignon $
Author:
Thomas Trapier
See Also:
Shape.distanceTo(Line), Shape.intersects(Line), Serialized Form
Use sample :

Creation with three Vector3D and two angles between 0.0 and PI/4: Vector3D origin = new Vector3D(1.0, 6.0, -2.0); Vector3D axis = new Vector3D(6.0, -3.0, -1.0); Vector3D uVector = new Vector3D(-5.0, 3.0, 0.0); InfiniteRectangleCone cone = new InfiniteRectangleCone(origin, axis, uVector, 0.82, 0.56); Intersection with a line : boolean intersects = cone(line);

Concurrency :
immutable

Constructor Summary
InfiniteRectangleCone(Vector3D inOrigin, Vector3D inDirection, Vector3D inUvector, double inAngleU, double inAngleV)
          Build an infinite rectangle cone from the position of its origin, its axis, a vector defining the orientation of the rectangle and two angles
 
Method Summary
 Vector3D[] closestPointTo(Line line)
          Computes the points of the shape and the line realizing the shortest distance.
 double distanceTo(Line line)
          Computes the distance to a line.
 double getAngleU()
           
 double getAngleV()
           
 Vector3D getAxis()
           
 Vector3D[] getIntersectionPoints(Line line)
          Compute the intersection points with a line.
 Vector3D getOrigin()
           
 Vector3D getU()
           
 Vector3D getV()
           
 boolean intersects(Line line)
          Tests the intersection with a line.
 String toString()
          Get a representation for this infinite rectangle cone.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InfiniteRectangleCone

public InfiniteRectangleCone(Vector3D inOrigin,
                             Vector3D inDirection,
                             Vector3D inUvector,
                             double inAngleU,
                             double inAngleV)
Build an infinite rectangle cone from the position of its origin, its axis, a vector defining the orientation of the rectangle and two angles

Parameters:
inOrigin - the origin of the cone
inDirection - the direction of the axis of the cone
inUvector - the input u vector : will be recomputed to be orthogonal to the axis and normalised
inAngleU - the angle of the pyramid on the U axis
inAngleV - the angle of the pyramid on the V axis
Throws:
IllegalArgumentException - if one of the angles is not between 0.0 and PI/2 or if the axis has a null norm
Method Detail

getOrigin

public Vector3D getOrigin()
Specified by:
getOrigin in interface InfiniteCone
Returns:
the origin

getAxis

public Vector3D getAxis()
Returns:
the axis

getU

public Vector3D getU()
Returns:
the U local frame vector

getV

public Vector3D getV()
Returns:
the V local frame vector

getAngleU

public double getAngleU()
Returns:
the angle on the U axis

getAngleV

public double getAngleV()
Returns:
the angle on the V axis

intersects

public boolean intersects(Line line)
Tests the intersection with a line.

Specified by:
intersects in interface Shape
Parameters:
line - the line
Returns:
true if the line intersects the shape

getIntersectionPoints

public Vector3D[] getIntersectionPoints(Line line)
Compute the intersection points with a line.

Specified by:
getIntersectionPoints in interface Shape
Parameters:
line - the line
Returns:
the intersection points if they exist. If no intersection is found, the dimension is zero

distanceTo

public double distanceTo(Line line)
Computes the distance to a line.

Specified by:
distanceTo in interface Shape
Parameters:
line - the line
Returns:
the shortest distance between the the line and the shape

closestPointTo

public Vector3D[] closestPointTo(Line line)
Computes the points of the shape and the line realizing the shortest distance. If the line intersects the shape, the returned points are identical : this point is the first common point found.

Specified by:
closestPointTo in interface Shape
Parameters:
line - the line
Returns:
the two points : first the one from the line, and the one from the shape.

toString

public String toString()
Get a representation for this infinite rectangle cone. The given parameters are in the same order as in the constructor.

Overrides:
toString in class Object
Returns:
a representation for this infinite rectangle cone


Copyright © 2016 CNES. All Rights Reserved.