Contents
- Description
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- copy(Cylindrical3D)
- set(Arc3D, double)
- setArc(Arc3D)
- setAxis(Line3D)
- getAxis()
- setHeight(double)
- baseArc()
- highArc()
- height()
- intersection(Line3D, List)
- intersectionRay(Line3D, List)
- intersectionSegment(Line3D, List)
- intersectionLength(Line3D, List)
- isOnSurface(Point3D)
- distanceToEdge(Point3D)
- translateXYZ(double, double, double)
- rotateX(double)
- rotateY(double)
- rotateZ(double)
- show()
- toString()
- point(int)
Class Cylindrical3D
java.lang.Object
org.jlab.geom.prim.Cylindrical3D
- All Implemented Interfaces:
Face3D
,Transformable
,Showable
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newCylindrical3D
such that the arc of the surface is centered around the z axis, the radius is one, the arc begins at x=1 y=0 and ends at x=0, y=1, and the arc has unit height such that it extends from z=0 to z=1.Cylindrical3D
(Arc3D arc, double height) Constructs a newCylindrical3D
from the given arc and height.Cylindrical3D
(Cylindrical3D cylindricalSeg) Constructs a newCylindrical3D
that is identical to the given cylindrical segment. -
Method Summary
Modifier and TypeMethodDescriptionbaseArc()
Returns the base of this cylindrical segment.void
copy
(Cylindrical3D cylindricalSeg) Sets the core parameters of this cylindrical segment such that this surface becomes identical to the given surface.double
distanceToEdge
(Point3D point) Distance between the point and the closest cylinder edgegetAxis()
returns the axis of this cylinder.double
height()
Returns the height of this cylindrical segment.highArc()
Constructs the arc at the top of this cylindrical segment.int
intersection
(Line3D line, List<Point3D> intersections) Finds the intersections of the given infinite line with thisFace3D
.double
intersectionLength
(Line3D line, List<Point3D> intersections) Compute the intersections of a ray within the 3D volumeint
intersectionRay
(Line3D line, List<Point3D> intersections) Finds the intersections of the given ray with thisFace3D
.int
intersectionSegment
(Line3D line, List<Point3D> intersections) Finds the intersections of the given line segment with thisFace3D
.boolean
isOnSurface
(Point3D point) Returns true if the given point is on the surface of this cylindrical segment.point
(int index) Returns the point from thisFace3D
with corresponding index.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
Sets the parameters of this cylindrical segment to equal the given parameters.void
Sets the base of this cylindrical segment.void
Sets the axis of this cylinder.void
setHeight
(double height) Sets the height of this cylindrical segment.void
show()
InvokesSystem.out.println(this)
.toString()
void
translateXYZ
(double dx, double dy, double dz) Translates this object linearly by the amounts specified.
-
Constructor Details
-
Cylindrical3D
public Cylindrical3D()Constructs a newCylindrical3D
such that the arc of the surface is centered around the z axis, the radius is one, the arc begins at x=1 y=0 and ends at x=0, y=1, and the arc has unit height such that it extends from z=0 to z=1. -
Cylindrical3D
Constructs a newCylindrical3D
from the given arc and height.- Parameters:
arc
- the base of the cylindrical segmentheight
- the height
-
Cylindrical3D
Constructs a newCylindrical3D
that is identical to the given cylindrical segment.- Parameters:
cylindricalSeg
- the cylindrical segment to copy
-
-
Method Details
-
copy
Sets the core parameters of this cylindrical segment such that this surface becomes identical to the given surface.- Parameters:
cylindricalSeg
- the cylindrical segment to copy
-
set
Sets the parameters of this cylindrical segment to equal the given parameters.- Parameters:
arc
- the base of the cylindrical segmentheight
- the height
-
setArc
Sets the base of this cylindrical segment.- Parameters:
arc
- the base of the cylindrical segment
-
setAxis
Sets the axis of this cylinder.- Parameters:
axis
- the base of the cylindrical segment
-
getAxis
returns the axis of this cylinder.- Returns:
- the axis of the cylindrical segment
-
setHeight
public void setHeight(double height) Sets the height of this cylindrical segment.- Parameters:
height
- the height
-
baseArc
Returns the base of this cylindrical segment.- Returns:
- the base of this cylindrical segment
-
highArc
Constructs the arc at the top of this cylindrical segment.- Returns:
- the arc at the top of this cylindrical segment
-
height
public double height()Returns the height of this cylindrical segment.- Returns:
- the height of this cylindrical segment.
-
intersection
Description copied from interface:Face3D
Finds the intersections of the given infinite line with thisFace3D
. If intersections are found they will be appended to the given list. The return value will indicate the number of intersections that were found.- Specified by:
intersection
in interfaceFace3D
- Parameters:
line
- the infinite lineintersections
- the list to store the intersections in- Returns:
- the number of intersections found
-
intersectionRay
Description copied from interface:Face3D
Finds the intersections of the given ray with thisFace3D
. If intersections are found they will be appended to the given list. The return value will indicate the number of intersections that were found.- Specified by:
intersectionRay
in interfaceFace3D
- Parameters:
line
- the rayintersections
- the list to store the intersections in- Returns:
- the number of intersections found
-
intersectionSegment
Description copied from interface:Face3D
Finds the intersections of the given line segment with thisFace3D
. If intersections are found they will be appended to the given list. The return value will indicate the number of intersections that were found.- Specified by:
intersectionSegment
in interfaceFace3D
- Parameters:
line
- the line segmentintersections
- the list to store the intersections in- Returns:
- the number of intersections found
-
intersectionLength
-
isOnSurface
Returns true if the given point is on the surface of this cylindrical segment.- Parameters:
point
- the point- Returns:
- true if the point is on the surface
-
distanceToEdge
Distance between the point and the closest cylinder edge- Parameters:
point
- the point- Returns:
- distance if point is on the surface, 0 otherwise
-
translateXYZ
public void translateXYZ(double dx, double dy, double dz) Description copied from interface:Transformable
Translates this object linearly by the amounts specified.- Specified by:
translateXYZ
in interfaceTransformable
- Parameters:
dx
- amount to translate along the x axisdy
- amount to translate along the y axisdz
- 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
-
point
Description copied from interface:Face3D
Returns the point from thisFace3D
with corresponding index. If an invalid index is given, then null is returned.
-