This page documents library functions that render curves, such as circles and ellipses.
Circle
Generate a circle at centre with radius .
Arguments
| Argument | Description | Domain | Constraints | Notes |
|---|---|---|---|---|
| centre | ||||
| radius | ||||
| calculator | ||||
| calculator |
Return
| Value | Description | Codomain | Constraints | Notes |
|---|---|---|---|---|
| projection |
Usage
Circles cannot be rendered by a function – an expression is needed. Compare the output of the renderer to using an inequality to render the circle.
d_{circle}\left(p_{centre},\ r,\ x,\ y\right)=\left(x-p_{centre}.x\right)^{2}+\left(y-p_{centre}.y\right)^{2}-r^{2}
d_{circle}\left(\left(2,\ 2\right),\ 1,\ x,\ y\right)\le0
d_{circle}\left(\left(5,\ 5\right),\ 10,\ x,\ y\right)\ge0 Implementation
For all points in the 2D plane, the renderer evaluates the formula of a circle with substituted in. Using an inequality renders the locus of points that form the circle.
Dependencies
None
Ellipse
Generate an ellipse at centre centre with radii .
Arguments
| Argument | Description | Domain | Constraints | Notes |
|---|---|---|---|---|
| calculator | ||||
| calculator |
Return
| Value | Description | Codomain | Constraints | Notes |
|---|---|---|---|---|
| projection |
Usage
Circles cannot be rendered by a function – an expression is needed. Compare the output of the renderer to using an inequality to render the circle.
d_{ellipse}\left(p_{centre},\ p_{radii},\ x,\ y\right)=\left(\frac{x-p_{centre}.x}{p_{radii}.x/p_{radii}.y}\right)^{2}+\left(y-p_{centre}.y\right)^{2}-p_{radii}.y^{2}
d_{ellipse}\left(\left(0,\ 0\right),\ R,\ x,\ y\right)\le0
R=\left(X,\ Y\right)
X=3
Y=2 Implementation
Essentially, we’re drawing a circle with radius , then scaling it by the ratio to form the ellipse.
Dependencies
None