AlgoSim
Homepage | Screenshots | Gallery of Visualisation | User's Guide | Function Reference | Download | FAQ | Support | Bugs and Solutions | Donate

Reference: createSet

createSet(expr) returns the set of all points (x, y) in [-10, 10]^2 that satisfies expr, a string containing an expression in x and y. Typically, this expression is a boolean statement utilizing a relation operator, such as =, <, or >. The default resolution 0.05 is used.

createSet(expr, res) uses the resolution res.

createSet(expr, xmin, xmax, ymin, ymax) tests only points within [xmin, xmax]×[ymin, ymax] with the default resolution 0.05.

createSet(expr, xmin, xmax, ymin, ymax, res) tests only points within [xmin, xmax]×[ymin, ymax] with the resolution res.

Example: Draw the (open) unit disk:
           set ≔ createSet("x^2 + y^2 < 1", -1, 1, -1, 1)
           drawSet("set")

Remark: The open unit disk may also be parametrized via γ(r, φ) = ❨r⋅cos(φ), r⋅sin(φ)❩ where r ∈ [0, 1] and φ ∈ [0, 2⋅π[. The parametric approach is much faster. The implicit createSet function is more useful for sets that cannot be (easily) parametrised.