开发者

how to draw a pulley in svg?

开发者 https://www.devze.com 2023-02-23 01:48 出处:网络
I want to draw a pulley shown under \"Standard Pulley Problem\" title at http://www.sparknotes.com/testprep/books/sat2/physics/chapter8section2.rhtml in svg and want to take values for m and M from us

I want to draw a pulley shown under "Standard Pulley Problem" title at http://www.sparknotes.com/testprep/books/sat2/physics/chapter8section2.rhtml in svg and want to take values for m and M from user using javascript. how can i do that?开发者_如何转开发


I would use Raphael.js since it works in every browser and it has an awesome API. You could even make it interactive, so that the user can drag "F" with their mouse to lift "m".


You can just develop the svg code first: http://www.w3schools.com/svg/svg_reference.asp and then develop a form to get the values.

Once you have this, then write the javascript to get the values entered on the form, using event handlers (http://www.quirksmode.org/js/introevents.html) and then do the appropriate calculation.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号