CartesianAxes

A CartesianAxes represents the axes of a Cartesian plot.

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.

Parameters:
NameTypeAttributesDescription
x_rangeClosedInterval

The x-range of the Cartesian axes.

y_rangeClosedInterval

The y-range of the Cartesian axes.

render_startPoint2D

The minimum coordinates of the Cartesian axes when rendered.

render_endPoint2D

The maximum coordinates of the Cartesian axes when rendered.

styleStyle | null<optional>

The style of each axis.

stroke_widthnumber | null<optional>

The stroke width of each axis.

x_labelVectorObjectBuilder | null<optional>

The x-axis label.

y_labelVectorObjectBuilder | null<optional>

The y-axis label.

x_ticksArray.<Tick> | null<optional>

The x-axis ticks.

y_ticksArray.<Tick> | null<optional>

The y-axis ticks.

Classes

CartesianAxes

Members

x_axis

Returns the x-axis of the Cartesian axes.

y_axis

Returns the y-axis of the Cartesian axes.

Methods

clone() → {CartesianAxes}

Clones the Cartesian axes.

Returns:
Type: 
CartesianAxes

coord_to_point(p) → {Point2D}

Returns the associated point of the given coordinates in the Cartesian axes.

Parameters:
NameTypeDescription
pPoint2D
Returns:

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.

Parameters:
NameTypeAttributesDescription
expression_xstring

The x function to plot.

expression_ystring

The y function to plot.

domainClosedInterval

The domain of the parametric function.

x_rangeClosedInterval

The x-range of the plot.

y_rangeClosedInterval

The y-range of the plot.

discontinuitiesArray.<number>

The discontinuities of the plot.

min_depthnumber | null<optional>

The minimum depth of the plot.

max_depthnumber | null<optional>

The maximum depth of the plot.

thresholdnumber | null<optional>

The threshold of the plot.

Returns:

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.

Parameters:
NameTypeDescription
pointPoint2D
Returns:

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.

Parameters:
NameTypeAttributesDescription
x_label_directionPoint2D | null<optional>

The direction of the x-label. The default is (1, 0).

x_label_offsetnumber | null<optional>

The offset of the x-label. The default is 20.0.

x_tick_label_directionPoint2D | null<optional>

The direction of the x-tick label. The default is (0, 1).

x_tick_label_offsetnumber | null<optional>

The offset of the x-tick label. The default is 10.0.

y_label_directionPoint2D | null<optional>

The direction of the y-label. The default is (1, 0).

y_label_offsetnumber | null<optional>

The offset of the y-label. The default is 20.0.

y_tick_label_directionPoint2D | null<optional>

The direction of the y-tick label. The default is (0, 1).

y_tick_label_offsetnumber | null<optional>

The offset of the y-tick label. The default is 10.0.

Returns:

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.

Parameters:
NameTypeAttributesDescription
tip_shapeVectorObjectBuilder

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_directionPoint2D | null<optional>

The direction of the x-label. The default is (1, 0).

x_label_offsetnumber | null<optional>

The offset of the x-label. The default is 20.0.

x_tick_label_directionPoint2D | null<optional>

The direction of the x-tick label. The default is (0, 1).

x_tick_label_offsetnumber | null<optional>

The offset of the x-tick label. The default is 10.0.

y_label_directionPoint2D | null<optional>

The direction of the y-label. The default is (1, 0).

y_label_offsetnumber | null<optional>

The offset of the y-label. The default is 20.0.

y_tick_label_directionPoint2D | null<optional>

The direction of the y-tick label. The default is (0, 1).

y_tick_label_offsetnumber | null<optional>

The offset of the y-tick label. The default is 10.0.

Returns:

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.

Parameters:
NameTypeAttributesDescription
tip_shapeVectorObjectBuilder

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_directionPoint2D | null<optional>

The direction of the x-label. The default is (1, 0).

x_label_offsetnumber | null<optional>

The offset of the x-label. The default is 20.0.

x_tick_label_directionPoint2D | null<optional>

The direction of the x-tick label. The default is (0, 1).

x_tick_label_offsetnumber | null<optional>

The offset of the x-tick label. The default is 10.0.

y_label_directionPoint2D | null<optional>

The direction of the y-label. The default is (1, 0).

y_label_offsetnumber | null<optional>

The offset of the y-label. The default is 20.0.

y_tick_label_directionPoint2D | null<optional>

The direction of the y-tick label. The default is (0, 1).

y_tick_label_offsetnumber | null<optional>

The offset of the y-tick label. The default is 10.0.

Returns:

A VectorObjectBuilder with the Cartesian axes and tip at the end of both axes.

Type: 
VectorObjectBuilder