Constructor
new CartesianAxes(x_range, y_range, render_start, render_end, styleopt, stroke_widthopt, x_labelopt, y_labelopt, x_ticksopt, y_ticksopt)
Creates a new CartesianAxes with the given x and y axes.
Name | Type | Attributes | Description |
---|---|---|---|
x_range | ClosedInterval | The x-range of the Cartesian axes. | |
y_range | ClosedInterval | The y-range of the Cartesian axes. | |
render_start | Point2D | The minimum coordinates of the Cartesian axes when rendered. | |
render_end | Point2D | The maximum coordinates of the Cartesian axes when rendered. | |
style | Style | | <optional> | The style of each axis. |
stroke_width | number | | <optional> | The stroke width of each axis. |
x_label | VectorObjectBuilder | | <optional> | The x-axis label. |
y_label | VectorObjectBuilder | | <optional> | The y-axis label. |
x_ticks | Array.<Tick> | | <optional> | The x-axis ticks. |
y_ticks | Array.<Tick> | | <optional> | The y-axis ticks. |
- Source
Classes
Members
x_axis
Returns the x-axis of the Cartesian axes.
- Source
y_axis
Returns the y-axis of the Cartesian axes.
- Source
Methods
clone() → {CartesianAxes}
Clones the Cartesian axes.
- Source
- Type:
- CartesianAxes
coord_to_point(p) → {Point2D}
Returns the associated point of the given coordinates in the Cartesian axes.
Name | Type | Description |
---|---|---|
p | Point2D |
- Source
The associated point of the given coordinates in the Cartesian axes.
- Type:
- Point2D
plot_function(expression_x, expression_y, domain, x_range, y_range, discontinuities, min_depthopt, max_depthopt, thresholdopt) → {ParametricFunctionPlot}
Returns the ParametricFunctionPlot object with the given function, relative to the Cartesian axes' coordinates.
Name | Type | Attributes | Description |
---|---|---|---|
expression_x | string | The x function to plot. | |
expression_y | string | The y function to plot. | |
domain | ClosedInterval | The domain of the parametric function. | |
x_range | ClosedInterval | The x-range of the plot. | |
y_range | ClosedInterval | The y-range of the plot. | |
discontinuities | Array.<number> | The discontinuities of the plot. | |
min_depth | number | | <optional> | The minimum depth of the plot. |
max_depth | number | | <optional> | The maximum depth of the plot. |
threshold | number | | <optional> | The threshold of the plot. |
- Source
The ParametricFunctionPlot object with the given function.
- Type:
- ParametricFunctionPlot
point_to_coord(point) → {Point2D}
Returns the associated coordinates of the given point in the Cartesian axes.
Name | Type | Description |
---|---|---|
point | Point2D |
- Source
The associated coordinates of the given point in the Cartesian axes.
- Type:
- Point2D
vector_object_builder(x_label_directionopt, x_label_offsetopt, x_tick_label_directionopt, x_tick_label_offsetopt, y_label_directionopt, y_label_offsetopt, y_tick_label_directionopt, y_tick_label_offsetopt) → {VectorObjectBuilder}
Gets the VectorObjectBuilder such that when built and rendered, the Cartesian axes are drawn.
Name | Type | Attributes | Description |
---|---|---|---|
x_label_direction | Point2D | | <optional> | The direction of the x-label. The default is (1, 0). |
x_label_offset | number | | <optional> | The offset of the x-label. The default is 20.0. |
x_tick_label_direction | Point2D | | <optional> | The direction of the x-tick label. The default is (0, 1). |
x_tick_label_offset | number | | <optional> | The offset of the x-tick label. The default is 10.0. |
y_label_direction | Point2D | | <optional> | The direction of the y-label. The default is (1, 0). |
y_label_offset | number | | <optional> | The offset of the y-label. The default is 20.0. |
y_tick_label_direction | Point2D | | <optional> | The direction of the y-tick label. The default is (0, 1). |
y_tick_label_offset | number | | <optional> | The offset of the y-tick label. The default is 10.0. |
- Source
A vector object builder with the Cartesian axes.
- Type:
- VectorObjectBuilder
with_tips_at_both_ends(tip_shape, x_label_directionopt, x_label_offsetopt, x_tick_label_directionopt, x_tick_label_offsetopt, y_label_directionopt, y_label_offsetopt, y_tick_label_directionopt, y_tick_label_offsetopt) → {VectorObjectBuilder}
Returns the VectorObjectBuilder with the Cartesian axes and tips at both ends of both axes.
Name | Type | Attributes | Description |
---|---|---|---|
tip_shape | VectorObjectBuilder | The shape of the tip. The shape must be pointing to the right, this function will rotate and move it to the correct angle. | |
x_label_direction | Point2D | | <optional> | The direction of the x-label. The default is (1, 0). |
x_label_offset | number | | <optional> | The offset of the x-label. The default is 20.0. |
x_tick_label_direction | Point2D | | <optional> | The direction of the x-tick label. The default is (0, 1). |
x_tick_label_offset | number | | <optional> | The offset of the x-tick label. The default is 10.0. |
y_label_direction | Point2D | | <optional> | The direction of the y-label. The default is (1, 0). |
y_label_offset | number | | <optional> | The offset of the y-label. The default is 20.0. |
y_tick_label_direction | Point2D | | <optional> | The direction of the y-tick label. The default is (0, 1). |
y_tick_label_offset | number | | <optional> | The offset of the y-tick label. The default is 10.0. |
- Source
A VectorObjectBuilder with the Cartesian axes and tips at both ends of both axes.
- Type:
- VectorObjectBuilder
with_tips_at_ends(tip_shape, x_label_directionopt, x_label_offsetopt, x_tick_label_directionopt, x_tick_label_offsetopt, y_label_directionopt, y_label_offsetopt, y_tick_label_directionopt, y_tick_label_offsetopt) → {VectorObjectBuilder}
Returns the VectorObjectBuilder with the Cartesian axes and tip at the end of both axes.
Name | Type | Attributes | Description |
---|---|---|---|
tip_shape | VectorObjectBuilder | The shape of the tip. The shape must be pointing to the right, this function will rotate and move it to the correct angle. | |
x_label_direction | Point2D | | <optional> | The direction of the x-label. The default is (1, 0). |
x_label_offset | number | | <optional> | The offset of the x-label. The default is 20.0. |
x_tick_label_direction | Point2D | | <optional> | The direction of the x-tick label. The default is (0, 1). |
x_tick_label_offset | number | | <optional> | The offset of the x-tick label. The default is 10.0. |
y_label_direction | Point2D | | <optional> | The direction of the y-label. The default is (1, 0). |
y_label_offset | number | | <optional> | The offset of the y-label. The default is 20.0. |
y_tick_label_direction | Point2D | | <optional> | The direction of the y-tick label. The default is (0, 1). |
y_tick_label_offset | number | | <optional> | The offset of the y-tick label. The default is 10.0. |
- Source
A VectorObjectBuilder with the Cartesian axes and tip at the end of both axes.
- Type:
- VectorObjectBuilder