简体   繁体   English

“向量”在javascript图形库中是什么意思

[英]What does “vector” means in javascript graph library

I am currently learning to use Springy which is a force directed graph layout algorithm in JavaScript. 我目前正在学习使用Springy ,这是JavaScript中的强制图布局算法。 There is a demo code springyui.js springyui.js , in the code, there are several places define " vector ", eg var targetBB = {bottomleft: new Vector(-2, -2), topright: new Vector(2, 2)}; 有一个演示代码springyui.js springyui.js,在代码中,有几个地方定义“ vector ”,例如var targetBB = {bottomleft: new Vector(-2, -2), topright: new Vector(2, 2)}; .

I don't understand what is the mean of vector in javascript graphic application, what does vector defines generally? 我不明白什么是在JavaScript的图形应用载体的意思是,确实载体通常定义?

It is a 2D vector . 它是2D 向量 In that library you could just consider it as a container of 2 numbers ( x , y ) representing a direction and magnitude on a plane. 在该库中,您可以将其视为包含2个数字( xy )的容器,分别表示平面上的方向和大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM