-
Notifications
You must be signed in to change notification settings - Fork 1
Built In Functions
In the following we list all built-in functions that are supported in Hydra, in alphabetical order. A Funktion is described as function(parameter1:(Type1), parameter2:(Type2), ...).
circle(center:(Pol), radius:(Number))Draws a hyperbolic circle with the passed radius, centered at the specified polar coordinate.
var r = 10
var point = Pol(r: 7.0, phi: M_PI / 8)
circle(center: point, radius: r)clear()Removes all objects from the canvas.
cos(x:(Number))Evaluates the cosine function at the passed value.
var a = cos(x: M_PI) // a = -1cosh(x:(Number))Evaluates the hyperbolic cosine function at the passed value.
var a = cosh(x: 0) // a = 1curve_angle(from:(Pol), to:(Pol), angle:(Number)) {_p:(Pol)}Draws a curve containing all points that have an angular distance of angle to the line between the points from and to.
The parameters from and to are polar coordinates that are required to have the same angular coordinate and the radius of from must be smaller than the radius of to.
The angle parameter needs to evaluate to a number. It is the only parameter that may contain the hidden variable _p. Basically curve_angle draws the curve by walking from point from to point to, and at each point _p evaluates angle, which may depend on _p.
var R = 10.0
var start = Pol(r: R / 2.0, phi: 0.0)
var end = Pol(r: R, phi: 0.0)
curve_angle(from: start, to: end, angle: theta(r1: _p.r, r2: _p.r, R))