Package renderer.models_L
Class ParametricCurve
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.ParametricCurve
-
- All Implemented Interfaces:
MeshMaker
public class ParametricCurve extends Model implements MeshMaker
Create a wireframe model of a parametric curve in space.- See Also:
ParametricSurface
-
-
Field Summary
Fields Modifier and Type Field Description int
n
double
t1
double
t2
DoubleFunction<Double>
x
DoubleFunction<Double>
y
DoubleFunction<Double>
z
-
Fields inherited from class renderer.scene.Model
colorList, name, primitiveList, vertexList, visible
-
-
Constructor Summary
Constructors Constructor Description ParametricCurve()
Create a trefoil knot as a parametric curve in space.ParametricCurve(DoubleFunction<Double> x, DoubleFunction<Double> y, double t1, double t2, int n)
Create a parametric curve in the xy-plane,ParametricCurve(DoubleFunction<Double> x, DoubleFunction<Double> y, DoubleFunction<Double> z, double t1, double t2, int n)
Create a parametric curve in space,
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHorzCount()
int
getVertCount()
ParametricCurve
remake(int n, int k)
Build an instance of theModel
with new values for the number of lines of latitude and longitude while keeping all the other model parameters the same.-
Methods inherited from class renderer.scene.Model
addColor, addPrimitive, addVertex, getPrimitive, toString
-
-
-
-
Field Detail
-
x
public final DoubleFunction<Double> x
-
y
public final DoubleFunction<Double> y
-
z
public final DoubleFunction<Double> z
-
t1
public final double t1
-
t2
public final double t2
-
n
public final int n
-
-
Constructor Detail
-
ParametricCurve
public ParametricCurve()
Create a trefoil knot as a parametric curve in space.
-
ParametricCurve
public ParametricCurve(DoubleFunction<Double> x, DoubleFunction<Double> y, double t1, double t2, int n)
Create a parametric curve in the xy-plane,
with the parameterx = x(t) y = y(t)
t
having the given parameter range and the given number of line segments.- Parameters:
x
- component function in the x-directiony
- component function in the y-directiont1
- beginning value of parameter ranget2
- ending value of parameter rangen
- number of line segments in the curve- Throws:
IllegalArgumentException
- ifn
is less than 1
-
ParametricCurve
public ParametricCurve(DoubleFunction<Double> x, DoubleFunction<Double> y, DoubleFunction<Double> z, double t1, double t2, int n)
Create a parametric curve in space,
with the parameterx = x(t) y = y(t) z = z(t)
t
having the given parameter range and the given number of line segments.- Parameters:
x
- component function in the x-directiony
- component function in the y-directionz
- component function in the z-directiont1
- beginning value of parameter ranget2
- ending value of parameter rangen
- number of line segments in the curve- Throws:
IllegalArgumentException
- ifn
is less than 1
-
-
Method Detail
-
getHorzCount
public int getHorzCount()
- Specified by:
getHorzCount
in interfaceMeshMaker
- Returns:
- the number of lines of latitude that the
Model
contains
-
getVertCount
public int getVertCount()
- Specified by:
getVertCount
in interfaceMeshMaker
- Returns:
- the number of lines of longitude that the
Model
contains
-
remake
public ParametricCurve remake(int n, int k)
Description copied from interface:MeshMaker
Build an instance of theModel
with new values for the number of lines of latitude and longitude while keeping all the other model parameters the same.
-
-