arcs circular segments r c arcs circular segments angles
play

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])


  1. ARCS ▪ circular segments r c

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

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

  4. QUADRATIC CURVES ▪ 1 control point p2 p1

  5. QUADRATIC CURVES ▪ 1 control point p2 p1

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

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

  8. CUBIC BEZIER CURVES cp2 ▪ 2 control points cp1 p2 p1

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

  10. CUBIC BEZIER CURVES ▪ 2 control points cp1 ▪ the shape of the curve is p2 infmuenced by the position of the control points... ▪ ...as well as their distance from each other p1 cp2

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

  12. PATH EXAMPLES Both of my shapes used the arc function. (Sorry, nothing too fancy!) 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();

  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 :)

  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/

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend