Contents
- Description
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- copy(Helix3D)
- set(Point3D, Point3D, Vector3D, double, double, boolean)
- setOrigin(Point3D)
- setCenter(Point3D)
- setNormal(Vector3D)
- setTotalHeight(double)
- setLoopHeight(double)
- setClockwise(boolean)
- origin()
- center()
- normal()
- totalHeight()
- loopHeight()
- clockwise()
- point(double)
- theta(double)
- isPointOnHelix(Point3D)
- translateXYZ(double, double, double)
- rotateX(double)
- rotateY(double)
- rotateZ(double)
- show()
- toString()
Class Helix3D
java.lang.Object
org.jlab.geom.prim.Helix3D
- All Implemented Interfaces:
Transformable
,Showable
- Author:
- jnhankins
-
Constructor Summary
ConstructorsConstructorDescriptionHelix3D()
Constructs a newHelix3D
centered around the origin, with its origin point at (1, 0, 0), looping once clockwise up the y-axis and ending at (1, 1, 0).Creates a newHelix3D
identical to the given helix.Helix3D
(Point3D origin, Point3D center, Vector3D normal, double totalHeight, double loopHeight, boolean clockwise) Constructs a helix from the given parameters. -
Method Summary
Modifier and TypeMethodDescriptioncenter()
Returns the central point of the helix.boolean
Returns true if the helix spirals clockwise around its central axis.void
Copies the parameters of the given helix so this helix is is identical to the given helix.boolean
isPointOnHelix
(Point3D point) Returns true if the point is on the helix (within 100nm).double
Returns the distance between winds of the helix.normal()
Returns the direction vector of the central axis.origin()
Returns the origin point on the helix.point
(double height) Returns the point on the helix at the specified height.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
(Point3D origin, Point3D center, Vector3D normal, double totalHeight, double loopHeight, boolean clockwise) Sets the parameters of this helix.void
Sets the center point of the helix.void
setClockwise
(boolean clockwise) Sets the clockwisedness of the loop.void
setLoopHeight
(double loopHeight) Sets the distance between winds of the helix.void
Sets the orientation of the central axis of the helix.void
Sets the starting point on the helix.void
setTotalHeight
(double totalHeight) Sets the total height of the helix measured along the central axis.void
show()
double
theta
(double height) Returns the angle of the point on the helix at the specified height relative to the origin point around the central axis.toString()
double
Returns the total height of the helix as measured along the central axis.void
translateXYZ
(double dx, double dy, double dz) Translates this object linearly by the amounts specified.
-
Constructor Details
-
Helix3D
public Helix3D()Constructs a newHelix3D
centered around the origin, with its origin point at (1, 0, 0), looping once clockwise up the y-axis and ending at (1, 1, 0). -
Helix3D
public Helix3D(Point3D origin, Point3D center, Vector3D normal, double totalHeight, double loopHeight, boolean clockwise) Constructs a helix from the given parameters.- Parameters:
origin
- the starting point on the helixcenter
- a point at the center of the spiral of the helixnormal
- the overall direction of the helixtotalHeight
- the total height of the helixloopHeight
- the distance between points on the helix after rotating through a full circleclockwise
- true if the helix orbits clockwise around its central axis
-
Helix3D
Creates a newHelix3D
identical to the given helix.- Parameters:
helix
- the helix to copy
-
-
Method Details
-
copy
Copies the parameters of the given helix so this helix is is identical to the given helix.- Parameters:
helix
- the helix to copy
-
set
public void set(Point3D origin, Point3D center, Vector3D normal, double totalHeight, double loopHeight, boolean clockwise) Sets the parameters of this helix.- Parameters:
origin
- the starting point on the helixcenter
- a point at the center of the spiral of the helixnormal
- the overall direction of the helixtotalHeight
- the total height of the helixloopHeight
- the distance between points on the helix after rotating through a full circleclockwise
- true if the helix orbits clockwise around its central axis
-
setOrigin
Sets the starting point on the helix.- Parameters:
origin
- the origin point
-
setCenter
Sets the center point of the helix.- Parameters:
center
- the center point
-
setNormal
Sets the orientation of the central axis of the helix.- Parameters:
normal
- the normal
-
setTotalHeight
public void setTotalHeight(double totalHeight) Sets the total height of the helix measured along the central axis.- Parameters:
totalHeight
- the total height
-
setLoopHeight
public void setLoopHeight(double loopHeight) Sets the distance between winds of the helix. The distance between some starting point on the helix and a point arrived at by traveling a complete 360 degrees around a loop the helix.- Parameters:
loopHeight
- the loop height
-
setClockwise
public void setClockwise(boolean clockwise) Sets the clockwisedness of the loop. If true the loop spirals clockwise around the central axis/normal.- Parameters:
clockwise
- if true then the helix spirals clockwise
-
origin
-
center
-
normal
Returns the direction vector of the central axis.- Returns:
- the normal vector
-
totalHeight
public double totalHeight()Returns the total height of the helix as measured along the central axis.- Returns:
- the total height
-
loopHeight
public double loopHeight()Returns the distance between winds of the helix. The distance between some starting point on the helix and a point arrived at by traveling a complete 360 degrees around a loop the helix.- Returns:
- the loop height
-
clockwise
public boolean clockwise()Returns true if the helix spirals clockwise around its central axis.- Returns:
- true if the helix spirals clockwise around its central axis
-
point
Returns the point on the helix at the specified height.- Parameters:
height
- the height- Returns:
- the point on the helix at the specified height.
-
theta
public double theta(double height) Returns the angle of the point on the helix at the specified height relative to the origin point around the central axis.- Parameters:
height
- the height- Returns:
- the angle of the point on the helix at that height
-
isPointOnHelix
Returns true if the point is on the helix (within 100nm).- Parameters:
point
- the point- Returns:
- true if the point is on the helix
-
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
-