Package renderer.models_L
Class ParametricSurface
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.ParametricSurface
-
- All Implemented Interfaces:
MeshMaker
- Direct Known Subclasses:
SurfaceOfRevolution
public class ParametricSurface extends Model implements MeshMaker
Create a wireframe model of a parametric surface in space.- See Also:
ParametricCurve
-
-
Field Summary
Fields Modifier and Type Field Description int
k
int
n
double
s1
double
s2
double
t1
double
t2
DoubleBinaryOperator
x
DoubleBinaryOperator
y
DoubleBinaryOperator
z
-
Fields inherited from class renderer.scene.Model
colorList, name, primitiveList, vertexList, visible
-
-
Constructor Summary
Constructors Constructor Description ParametricSurface()
Create a graph of the function with the following formula,ParametricSurface(DoubleBinaryOperator f, double x1, double x2, double z1, double z2, int n, int k)
Create a graph of a function of two variablesy = f(x, z)
as a parametric surface with the given parameter ranges in thex
andz
directions.ParametricSurface(DoubleBinaryOperator x, DoubleBinaryOperator y, DoubleBinaryOperator z, double s1, double s2, double t1, double t2, int n, int k)
Create a parametric surface in space,ParametricSurface(DoubleBinaryOperator x, DoubleBinaryOperator y, DoubleBinaryOperator z, double s1, double s2, double t1, double t2, int n, int k, String name)
Create a parametric surface in space,
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHorzCount()
int
getVertCount()
ParametricSurface
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 DoubleBinaryOperator x
-
y
public final DoubleBinaryOperator y
-
z
public final DoubleBinaryOperator z
-
s1
public final double s1
-
s2
public final double s2
-
t1
public final double t1
-
t2
public final double t2
-
n
public final int n
-
k
public final int k
-
-
Constructor Detail
-
ParametricSurface
public ParametricSurface()
Create a graph of the function with the following formula,
as a parametric surface.f(x,z) = sin(PI*x) * sin(PI*z)
-
ParametricSurface
public ParametricSurface(DoubleBinaryOperator f, double x1, double x2, double z1, double z2, int n, int k)
Create a graph of a function of two variablesy = f(x, z)
as a parametric surface with the given parameter ranges in thex
andz
directions.- Parameters:
f
- function of x and zx1
- beginning value of x-parameter rangex2
- ending value of x-parameter rangez1
- beginning value of y-parameter rangez2
- ending value of z-parameter rangen
- number of mesh lines in x-rangek
- number of mesh lines in y-range- Throws:
IllegalArgumentException
- ifn
is less than 2IllegalArgumentException
- ifk
is less than 2
-
ParametricSurface
public ParametricSurface(DoubleBinaryOperator x, DoubleBinaryOperator y, DoubleBinaryOperator z, double s1, double s2, double t1, double t2, int n, int k)
Create a parametric surface in space,
with the parametersx = x(s,t) y = y(s,t) z = z(s,t)
s
andt
having the given parameter ranges and the given number of mesh lines in each parametric direction.- Parameters:
x
- component function in the x-directiony
- component function in the y-directionz
- component function in the z-directions1
- beginning value of first parameter ranges2
- ending value of first parameter ranget1
- beginning value of second parameter ranget2
- ending value of second parameter rangen
- number of mesh lines in first rangek
- number of mesh lines in second range- Throws:
IllegalArgumentException
- ifn
is less than 2IllegalArgumentException
- ifk
is less than 2
-
ParametricSurface
public ParametricSurface(DoubleBinaryOperator x, DoubleBinaryOperator y, DoubleBinaryOperator z, double s1, double s2, double t1, double t2, int n, int k, String name)
Create a parametric surface in space,
with the parametersx = x(s,t) y = y(s,t) z = z(s,t)
s
andt
having the given parameter ranges and the given number of mesh lines in each parametric direction.- Parameters:
x
- component function in the x-directiony
- component function in the y-directionz
- component function in the z-directions1
- beginning value of first parameter ranges2
- ending value of first parameter ranget1
- beginning value of second parameter ranget2
- ending value of second parameter rangen
- number of mesh lines in first rangek
- number of mesh lines in second rangename
-String
name for this surface- Throws:
IllegalArgumentException
- ifn
is less than 2IllegalArgumentException
- ifk
is less than 2
-
-
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 ParametricSurface 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.
-
-