@@ -25,6 +25,13 @@ export default class Vec2d implements Point {
return`[${this.x}, ${this.y}]`;
}
toPolar() {
return{
r: this.length(),
theta: Math.atan2(this.y,this.x),
};
}
normalize():Vec2d{
constlen=this.length();
returnnewVec2d(this.x/len,this.y/len);
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.