The parametric_plots library is part of the graphics library.
Example
import geometry;
import graphics;
import graphics/parametric_plots;
define plot =
begin
scene := empty_scene("plot");
fun := (u, v) -> vector3d(u,v, 1/(u*v));
range := make_range(-5, 5, -5, 5);
options := default_parametric_plot_options;
options := with_parametric_plot_options_n(50, options);
scene := plot_parametric_surface(fun, range, options, scene);
scene := plot_parametric_surface_grid(fun, range, options, scene);
return scene;
end;
Use the pacioli_scene web-component to display the plot in a web-page.
default_parametric_plot_options :: ParametricPlotOptions interval_length :: for_unit a: (Interval(a)) -> a interval_lower :: for_unit a: (Interval(a)) -> a interval_upper :: for_unit a: (Interval(a)) -> a make_interval :: for_unit a: (a, a) -> Interval(a) make_parametric_plot_options :: (1, 1, 1, 1, Boole, Boole, Boole, Boole, String, Color, Color, Color) -> ParametricPlotOptions make_range :: for_unit a, b: (a, a, b, b) -> Range2D(a, b) make_range2d :: for_unit a, b: (Interval(a), Interval(b)) -> Range2D(a, b) parametric_plot_options_color :: (ParametricPlotOptions) -> Color parametric_plot_options_delta_color :: (ParametricPlotOptions) -> Color parametric_plot_options_m :: (ParametricPlotOptions) -> 1 parametric_plot_options_n :: (ParametricPlotOptions) -> 1 parametric_plot_options_normal_color :: (ParametricPlotOptions) -> Color parametric_plot_options_scale_factor :: (ParametricPlotOptions) -> 1 parametric_plot_options_show_normals :: (ParametricPlotOptions) -> Boole parametric_plot_options_show_parts :: (ParametricPlotOptions) -> Boole parametric_plot_options_show_total :: (ParametricPlotOptions) -> Boole parametric_plot_options_wireframe :: (ParametricPlotOptions) -> Boole plot_parametric_path :: for_unit a, b, c, Geom3!u: ((a, b) -> c*Geom3!u, a, b, a, b, ParametricPlotOptions, Scene(c, Geom3!u)) -> Scene(c, Geom3!u) plot_parametric_surface :: for_unit a, b, c, Geom3!u: ((a, b) -> c*Geom3!u, Range2D(a, b), ParametricPlotOptions, Scene(c, Geom3!u)) -> Scene(c, Geom3!u) plot_parametric_surface_deltas :: for_unit a, b, c, Geom3!u: ((a, b) -> c*Geom3!u, Range2D(a, b), ParametricPlotOptions, Scene(c, Geom3!u)) -> Scene(c, Geom3!u) plot_parametric_surface_grid :: for_unit a, b, c, Geom3!u: ((a, b) -> c*Geom3!u, Range2D(a, b), ParametricPlotOptions, Scene(c, Geom3!u)) -> Scene(c, Geom3!u) range2d_u :: for_unit a, b: (Range2D(a, b)) -> Interval(a) range2d_v :: for_unit a, b: (Range2D(a, b)) -> Interval(b) range_height :: for_unit a, b: (Range2D(a, b)) -> b range_ustart :: for_unit a, b: (Range2D(a, b)) -> a range_vstart :: for_unit a, b: (Range2D(a, b)) -> b range_width :: for_unit a, b: (Range2D(a, b)) -> a scale_interval :: for_unit a, b: (a, Interval(b)) -> Interval(a*b) scale_range :: for_unit a, b, c, d: (a, b, Range2D(c, d)) -> Range2D(a*c, b*d) with_interval_lower :: for_unit a: (a, Interval(a)) -> Interval(a) with_interval_upper :: for_unit a: (a, Interval(a)) -> Interval(a) with_parametric_plot_options_color :: (Color, ParametricPlotOptions) -> ParametricPlotOptions with_parametric_plot_options_delta_color :: (Color, ParametricPlotOptions) -> ParametricPlotOptions with_parametric_plot_options_m :: (1, ParametricPlotOptions) -> ParametricPlotOptions with_parametric_plot_options_n :: (1, ParametricPlotOptions) -> ParametricPlotOptions with_parametric_plot_options_normal_color :: (Color, ParametricPlotOptions) -> ParametricPlotOptions with_parametric_plot_options_scale_factor :: (1, ParametricPlotOptions) -> ParametricPlotOptions with_parametric_plot_options_show_normals :: (Boole, ParametricPlotOptions) -> ParametricPlotOptions with_parametric_plot_options_show_parts :: (Boole, ParametricPlotOptions) -> ParametricPlotOptions with_parametric_plot_options_show_total :: (Boole, ParametricPlotOptions) -> ParametricPlotOptions with_parametric_plot_options_wireframe :: (Boole, ParametricPlotOptions) -> ParametricPlotOptions with_range2d_u :: for_unit a, b: (Interval(a), Range2D(a, b)) -> Range2D(a, b) with_range2d_v :: for_unit a, b: (Interval(b), Range2D(a, b)) -> Range2D(a, b)
ParametricPlotOptions
Options for plotting parametric surfaces, grids and deltas.
:: ParametricPlotOptions
Default values for the options for parametric plots.
:: for_unit a: (Interval(a)) -> a
:: for_unit a: (Interval(a)) -> a
Getter for record Interval(a)
:: for_unit a: (Interval(a)) -> a
Getter for record Interval(a)
:: for_unit a: (a, a) -> Interval(a)
Constructor for record Interval(a)
:: (1, 1, 1, 1, Boole, Boole, Boole, Boole, String, Color, Color, Color) -> ParametricPlotOptions
Constructor for record ParametricPlotOptions
:: for_unit a, b: (a, a, b, b) -> Range2D(a, b)
:: for_unit a, b: (Interval(a), Interval(b)) -> Range2D(a, b)
Constructor for record Range2D(a, b)
:: (ParametricPlotOptions) -> Color
Getter for record ParametricPlotOptions
:: (ParametricPlotOptions) -> Color
Getter for record ParametricPlotOptions
:: (ParametricPlotOptions) -> 1
Getter for record ParametricPlotOptions
:: (ParametricPlotOptions) -> 1
Getter for record ParametricPlotOptions
:: (ParametricPlotOptions) -> Color
Getter for record ParametricPlotOptions
:: (ParametricPlotOptions) -> 1
Getter for record ParametricPlotOptions
:: (ParametricPlotOptions) -> Boole
Getter for record ParametricPlotOptions
:: (ParametricPlotOptions) -> Boole
Getter for record ParametricPlotOptions
:: (ParametricPlotOptions) -> Boole
Getter for record ParametricPlotOptions
:: (ParametricPlotOptions) -> Boole
Getter for record ParametricPlotOptions
:: for_unit a, b, c, Geom3!u: ((a, b) -> c*Geom3!u, a, b, a, b, ParametricPlotOptions, Scene(c, Geom3!u)) -> Scene(c, Geom3!u)
:: for_unit a, b, c, Geom3!u: ((a, b) -> c*Geom3!u, Range2D(a, b), ParametricPlotOptions, Scene(c, Geom3!u)) -> Scene(c, Geom3!u)
Plots a parametric surface in a 3D space.
The function parameter is a function from the given range to Geom3
vectors. The function is sampled for the given range to give the surface points.
The number of samples, and other parameters like color, can be set in the options.
For example
let
u_interval = make_interval(-5*|metre|, 5*|metre|),
v_interval = make_interval(-5*|metre|, 5*|metre|)
in
plot_parametric_surface(
(u, v) -> vector3d(u, v, 3*|metre| - 0.5*u - 0.2*v),
make_range2d(u_interval, v_interval),
default_parametric_plot_options,
scene)
end
plots a part of a plane, using default options. It yields a scene of
type Scene(metre, Geom3!)
:: for_unit a, b, c, Geom3!u: ((a, b) -> c*Geom3!u, Range2D(a, b), ParametricPlotOptions, Scene(c, Geom3!u)) -> Scene(c, Geom3!u)
:: for_unit a, b, c, Geom3!u: ((a, b) -> c*Geom3!u, Range2D(a, b), ParametricPlotOptions, Scene(c, Geom3!u)) -> Scene(c, Geom3!u)
Plots a parametric grid in a 3D space.
The function parameter is a function from the given range to Geom3
vectors. The function is sampled for the given range to give the grid points.
The number of samples, and other parameters like color, can be set in the options.
It is similar to plotting a surface using plot_parametric_surface with
the option wireframe, but it displays rectangles instead of triangles.
:: for_unit a, b: (Range2D(a, b)) -> Interval(a)
Getter for record Range2D(a, b)
:: for_unit a, b: (Range2D(a, b)) -> Interval(b)
Getter for record Range2D(a, b)
:: for_unit a, b: (Range2D(a, b)) -> b
:: for_unit a, b: (Range2D(a, b)) -> a
:: for_unit a, b: (Range2D(a, b)) -> b
:: for_unit a, b: (Range2D(a, b)) -> a
:: for_unit a, b: (a, Interval(b)) -> Interval(a*b)
:: for_unit a, b, c, d: (a, b, Range2D(c, d)) -> Range2D(a*c, b*d)
:: for_unit a: (a, Interval(a)) -> Interval(a)
Setter for record Interval(a)
:: for_unit a: (a, Interval(a)) -> Interval(a)
Setter for record Interval(a)
:: (Color, ParametricPlotOptions) -> ParametricPlotOptions
Setter for record ParametricPlotOptions
:: (Color, ParametricPlotOptions) -> ParametricPlotOptions
Setter for record ParametricPlotOptions
:: (1, ParametricPlotOptions) -> ParametricPlotOptions
Setter for record ParametricPlotOptions
:: (1, ParametricPlotOptions) -> ParametricPlotOptions
Setter for record ParametricPlotOptions
:: (Color, ParametricPlotOptions) -> ParametricPlotOptions
Setter for record ParametricPlotOptions
:: (1, ParametricPlotOptions) -> ParametricPlotOptions
Setter for record ParametricPlotOptions
:: (Boole, ParametricPlotOptions) -> ParametricPlotOptions
Setter for record ParametricPlotOptions
:: (Boole, ParametricPlotOptions) -> ParametricPlotOptions
Setter for record ParametricPlotOptions
:: (Boole, ParametricPlotOptions) -> ParametricPlotOptions
Setter for record ParametricPlotOptions
:: (Boole, ParametricPlotOptions) -> ParametricPlotOptions
Setter for record ParametricPlotOptions
:: for_unit a, b: (Interval(a), Range2D(a, b)) -> Range2D(a, b)
Setter for record Range2D(a, b)
:: for_unit a, b: (Interval(b), Range2D(a, b)) -> Range2D(a, b)
Setter for record Range2D(a, b)
Version v0.6.0, 2026-03-05T15:49:23.365449441+01:00[Europe/Amsterdam]