This repository has been archived by the owner on Apr 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Shape
Atsuya Sato edited this page Nov 30, 2018
·
6 revisions
iOS, OSX
point(30, 20)
point(85, 20)
point(85, 75)
point(30, 75)
Draws a point.
iOS, OSX
line(30, 20, 85, 75)
Draws a line.
iOS, OSX
rect(30, 20, 55, 55)
Draws a rectangle.
iOS, OSX
ellipse(56, 46, 55, 55)
Draws an ellipse.
iOS, OSX
arc(50, 50, 20, 0, PI+QUARTER_PI)
Draws an arc.
iOS, OSX
triangle(30, 75, 58, 20, 86, 75)
Draws a triangle.
quad(_ x1: CGFloat, _ y1: CGFloat, _ x2: CGFloat, _ y2: CGFloat, _ x3: CGFloat, _ y3: CGFloat, _ x4: CGFloat, _ y4: CGFloat)
iOS, OSX
quad(38, 31, 86, 20, 69, 63, 30, 76)
Draws a triangle.
curve(_ cpx1: CGFloat, _ cpy1: CGFloat, _ x1: CGFloat, _ y1: CGFloat, _ x2: CGFloat, _ y2: CGFloat, _ cpx2: CGFloat, _ cpy2: CGFloat)
iOS, OSX
curve(5, 26, 73, 24, 73, 61, 15, 65)
Draws a curved line.
bezier(_ x1: CGFloat, _ y1: CGFloat, _ cpx1: CGFloat, _ cpy1: CGFloat, _ cpx2: CGFloat, _ cpy2: CGFloat, _ x2: CGFloat, _ y2: CGFloat)
iOS, OSX
bezier(85, 20, 10, 10, 90, 90, 15, 80)
Draws a Bezier curve.
iOS, OSX
let deg = 45
let rad = radians(deg)
Converts a degree measurement to its corresponding value in radians.