svg和javascript [英] svg and javascript

查看:70
本文介绍了svg和javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Java语言的新手,我想实现一个滑轮,在其中我需要使用SVG画一个圆,并在圆上连接2根线,使其直径触及圆周.我还想显示在这些字符串的末尾附加2个矩形块,它们将具有2个权重 w1 w2 .从用户输入 w1 w2 作为输入,我需要计算弦的张力为 T1 = w1 * g .同样,如果 w1> w2 块将与字符串一起向下移动.如何使用SVG和Javascript来实现它?

I am new to javascript and I want to implement a pulley in which I need to draw a circle using SVG to which 2 strings are attached touching to its circumference at diameter. Also I want to show 2 rectangular blocks attached to these strings at the end which will have 2 weights w1 an w2. Taking w1 and w2 as inputs from the user, I need to calculate the tension on the string as T1 = w1*g. Also if w1 > w2 block will move downwards along with the string. How can I implement it using SVG and Javascript?

推荐答案

看看我引用的 Raphael JS :

Raphaël是一个小型JavaScript库,可以简化网络上矢量图形的工作.

Raphaël is a small JavaScript library that should simplify your work with vector graphics on the web.

这篇关于svg和javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆