Contents
- Description
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- copy(Plane3D)
- set(Point3D, Vector3D)
- setNormal(Vector3D)
- setPoint(Point3D)
- set(double, double, double, double, double, double)
- setPoint(double, double, double)
- setNormal(double, double, double)
- point()
- normal()
- distance(Point3D, Line3D)
- intersection(Line3D, Point3D)
- intersectionRay(Line3D, Point3D)
- intersectionSegment(Line3D, Point3D)
- intersection(Plane3D, Line3D)
- intersection(Plane3D, Plane3D, Point3D)
- translateXYZ(double, double, double)
- rotateX(double)
- rotateY(double)
- rotateZ(double)
- show()
- toString()
Class Plane3D
java.lang.Object
org.jlab.geom.prim.Plane3D
- All Implemented Interfaces:
Transformable
,Showable
An infinite unbounded 3D plane represented by a vector that is normal to the
plane and a reference point on the plane.
Plane3D
contains intersection finding functions for
infinite lines
,
rays
,
line segments
,
one other plane
, and
two other planes
.
- Author:
- gavalian
-
Constructor Summary
ConstructorsConstructorDescriptionPlane3D()
Constructs a newPlane3D
such that the reference point is at the origin and the normal vector is a null vector.Plane3D
(double px, double py, double pz, double nx, double ny, double nz) Constructs a newPlane3D
such that the new plane passes through the point specified by the first the given values and the normal of the new plane is parallel to the the vector specified by the last three given values.Constructs a newPlane3D
that is equivalent to the given plane.Constructs a newPlane3D
such that the new plane passes through the given point and the normal of the new plane is parallel to the given vector. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Sets the reference point and normal of this plane to coincide with the reference point and normal of the given plane.void
Calculates a Line3D object with origin at the given point and the end at the plane, length is the distance to the plane.int
intersection
(Line3D line, Point3D intersect) Finds the intersection of the given infinite with this plane.int
intersection
(Plane3D plane, Line3D intersect) Finds the intersection of the given plane with this plane.boolean
intersection
(Plane3D plane1, Plane3D plane2, Point3D intersect) Finds the intersection of the two given planes and this plane.int
intersectionRay
(Line3D line, Point3D intersect) Finds the intersection of the given ray with this plane.int
intersectionSegment
(Line3D line, Point3D intersect) Finds the intersection of the given line segment with this plane.normal()
Returns the normal of this plane.point()
Returns the reference point of this plane.void
rotateX
(double angle) Rotates this object clockwise around the x axis.void
rotateY
(double angle) Rotates this object clockwise around the y axis.void
rotateZ
(double angle) Rotates this object clockwise around the z axis.void
set
(double px, double py, double pz, double nx, double ny, double nz) Sets the coordinates of the reference point and components of the normal vector of this plane using the given values.void
Sets the reference point and normal of this plane to coincide with the given point and vector.void
setNormal
(double nx, double ny, double nz) Sets the components of the normal vector of this plane.void
Sets the normal of this plane to parallel the given vector.void
setPoint
(double px, double py, double pz) Sets the coordinates of the reference point of this plane.void
Sets the reference point of this plane.void
show()
InvokesSystem.out.println(this)
.toString()
void
translateXYZ
(double x, double y, double z) Translates this object linearly by the amounts specified.
-
Constructor Details
-
Plane3D
public Plane3D()Constructs a newPlane3D
such that the reference point is at the origin and the normal vector is a null vector. -
Plane3D
-
Plane3D
public Plane3D(double px, double py, double pz, double nx, double ny, double nz) Constructs a newPlane3D
such that the new plane passes through the point specified by the first the given values and the normal of the new plane is parallel to the the vector specified by the last three given values.- Parameters:
px
- the x coordinate of the pointpy
- the y coordinate of the pointpz
- the z coordinate of the pointnx
- the x component of the normalny
- the y component of the normalnz
- the z component of the normal
-
Plane3D
Constructs a newPlane3D
that is equivalent to the given plane.- Parameters:
plane
- the plane to copy
-
-
Method Details
-
copy
Sets the reference point and normal of this plane to coincide with the reference point and normal of the given plane.- Parameters:
plane
- the line to copy
-
set
-
setNormal
Sets the normal of this plane to parallel the given vector.- Parameters:
normal
- the normal
-
setPoint
Sets the reference point of this plane.- Parameters:
point
- the reference point
-
set
public void set(double px, double py, double pz, double nx, double ny, double nz) Sets the coordinates of the reference point and components of the normal vector of this plane using the given values.- Parameters:
px
- the x coordinate of the pointpy
- the y coordinate of the pointpz
- the z coordinate of the pointnx
- the x component of the normalny
- the y component of the normalnz
- the z component of the normal
-
setPoint
public void setPoint(double px, double py, double pz) Sets the coordinates of the reference point of this plane.- Parameters:
px
- the x coordinate of the pointpy
- the y coordinate of the pointpz
- the z coordinate of the point
-
setNormal
public void setNormal(double nx, double ny, double nz) Sets the components of the normal vector of this plane.- Parameters:
nx
- the x component of the normalny
- the y component of the normalnz
- the z component of the normal
-
point
-
normal
-
distance
-
intersection
Finds the intersection of the given infinite with this plane. If an intersection point is found it will be stored in the given point. Return codes: 0 = disjoint, 1 = intersecting, 2 = coinciding.- Parameters:
line
- the infinite lineintersect
- the intersection point- Returns:
- 0 = disjoint, 1 = intersecting, 2 = coinciding
-
intersectionRay
Finds the intersection of the given ray with this plane. If an intersection point is found it will be stored in the given point. Return codes: 0 = disjoint, 1 = intersecting, 2 = coinciding.- Parameters:
line
- the ray segmentintersect
- the intersection point- Returns:
- 0 = disjoint, 1 = intersecting, 2 = coinciding
-
intersectionSegment
Finds the intersection of the given line segment with this plane. If an intersection point is found it will be stored in the given point. Return codes: 0 = disjoint, 1 = intersecting, 2 = coinciding.- Parameters:
line
- the line segmentintersect
- the intersection point- Returns:
- 0 = disjoint, 1 = intersecting, 2 = coinciding
-
intersection
Finds the intersection of the given plane with this plane. If an intersection line is found it will be stored in the given line. Return codes: 0 = disjoint, 1 = intersecting, 2 = coinciding.- Parameters:
plane
- the lineintersect
- the intersection line- Returns:
- 0 = disjoint, 1 = intersecting, 2 = coinciding
-
intersection
Finds the intersection of the two given planes and this plane. If an intersection point is found it will be stored in the given point. Returns true if an intersection was found.- Parameters:
plane1
- the first planeplane2
- the second planeintersect
- the intersection point- Returns:
- true if the intersection was found
-
translateXYZ
public void translateXYZ(double x, double y, double z) Description copied from interface:Transformable
Translates this object linearly by the amounts specified.- Specified by:
translateXYZ
in interfaceTransformable
- Parameters:
x
- amount to translate along the x axisy
- amount to translate along the y axisz
- amount to translate along the z axis
-
rotateX
public void rotateX(double angle) Description copied from interface:Transformable
Rotates this object clockwise around the x axis.- Specified by:
rotateX
in interfaceTransformable
- Parameters:
angle
- rotation angle in radians
-
rotateY
public void rotateY(double angle) Description copied from interface:Transformable
Rotates this object clockwise around the y axis.- Specified by:
rotateY
in interfaceTransformable
- Parameters:
angle
- rotation angle in radians
-
rotateZ
public void rotateZ(double angle) Description copied from interface:Transformable
Rotates this object clockwise around the z axis.- Specified by:
rotateZ
in interfaceTransformable
- Parameters:
angle
- rotation angle in radians
-
show
-
toString
-