ARCS circular segments r c ARCS circular segments angles are - - PowerPoint PPT Presentation

arcs circular segments r c arcs circular segments angles
SMART_READER_LITE
LIVE PREVIEW

ARCS circular segments r c ARCS circular segments angles are - - PowerPoint PPT Presentation

ARCS circular segments r c ARCS circular segments angles are calculated clockwise from 0 r in the +x direction, c unless specifjed otherwise (x,y) r d3.path().arc(x, y, r, , [, counterclockwise])


slide-1
SLIDE 1

c r ARCS ▪ circular segments

slide-2
SLIDE 2

c θ ɸ ARCS ▪ circular segments ▪ angles are calculated clockwise from 0˚ in the +x direction, unless specifjed

  • therwise

r

slide-3
SLIDE 3

(x,y) θ ɸ r d3.path().arc(x, y, r, θ, ɸ[, counterclockwise])

slide-4
SLIDE 4

p1 p2 QUADRATIC CURVES ▪ 1 control point

slide-5
SLIDE 5

p1 p2 QUADRATIC CURVES ▪ 1 control point

slide-6
SLIDE 6

cp p1 p2 QUADRATIC CURVES ▪ 1 control point ▪ point lies on the curve

slide-7
SLIDE 7

(cpx, cpy) (x,y) d3.path().quadraticCurveTo(cpx, cpy, x, y) path starting point

slide-8
SLIDE 8

cp2 cp1 p1 p2 CUBIC BEZIER CURVES ▪ 2 control points

slide-9
SLIDE 9

p1 cp1 cp2 p2 CUBIC BEZIER CURVES ▪ 2 control points ▪ the shape of the curve is infmuenced by the position

  • f the control points...
slide-10
SLIDE 10

p1 cp1 cp2 p2 CUBIC BEZIER CURVES ▪ 2 control points ▪ the shape of the curve is infmuenced by the position

  • f the control points...

▪ ...as well as their distance from each other

slide-11
SLIDE 11

path starting point (cpx1, cpy1) (cpx2, cpy2) (x, y) d3.path().bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x, y)

slide-12
SLIDE 12

var r = 5; ctx = d3.path(); ctx.arc(0, -r, r, 0, Math.PI) ctx.arc(-r, 0, r, -Math.PI/2, Math.PI/2) ctx.arc(0, r, r, Math.PI, 0) ctx.arc(r, 0, r, Math.PI/2, -Math.PI/2) return ctx.toString(); PATH EXAMPLES Both of my shapes used the arc function. (Sorry, nothing too fancy!)

slide-13
SLIDE 13

PATH EXAMPLES There’s a surprising amount you can do with circles... such as simulating wave motion! http://bl.ocks.org/mbostock/c66ab1426f- 4b8945a7ef If possible, try to keep the shapes simple. Let your computer handle all the math :)

slide-14
SLIDE 14

ADDITIONAL LINKS ▪ d3 path reference https://github.com/d3/d3-path ▪ some decent d3 tutorials https://www.dashingd3js.com/svg-paths- and-d3js ▪ practicing bezier curves :3 http://bezier.method.ac/