MCPcopy Index your code
hub / github.com/graphif/project-graph / angle

Method angle

packages/data-structures/src/Vector.ts:99–105  ·  view source on GitHub ↗

* 计算自己向量与另一个向量之间的角度 * @param vector * @returns 单位:弧度

(vector: Vector)

Source from the content-addressed store, hash-verified

97 * @returns 单位:弧度
98 */
99 angle(vector: Vector): number {
100 const dot = this.dot(vector);
101 const mag1 = this.magnitude();
102 const mag2 = vector.magnitude();
103
104 return Math.acos(dot / (mag1 * mag2));
105 }
106 /**
107 * 计算自己向量与另一个向量之间的夹角
108 * @param vector

Callers 2

angleToMethod · 0.95
Vector.test.tsFile · 0.80

Calls 2

dotMethod · 0.95
magnitudeMethod · 0.95

Tested by

no test coverage detected