This example shows the effect of the asin()
function.
let result = asin(value)
To run this example you need to include the MathComparePaths.swift file in your project.
let example = MathComparePaths(frame: canvas.frame) {
var points = [Point]()
var x = -1.0
repeat {
let y = asin(x)
let mx = map(x, min: -1, max: 1, toMin: 0, toMax: 1)
let my = map(y, min: 0, max: M_PI_2, toMin: 0, toMax: 1) * -1.0
points.append(Point(mx, my))
x += 0.002
} while x < 1
return (points, points)
}
canvas.add(example)