UNPKG

roslib

Version:

The standard ROS Javascript Library

50 lines (49 loc) 1.13 kB
import { IQuaternion } from './Quaternion.ts'; import { PartialNullable } from '../types/interface-types.ts'; export interface IVector3 { /** * The x value. */ x: number; /** * The y value. */ y: number; /** * The z value. */ z: number; } /** * A 3D vector. */ export default class Vector3 implements IVector3 { x: number; y: number; z: number; constructor(options?: PartialNullable<IVector3> | null); /** * Set the values of this vector to the sum of itself and the given vector. * * @param v - The vector to add with. */ add(v: IVector3): void; /** * Set the values of this vector to the difference of itself and the given vector. * * @param v - The vector to subtract with. */ subtract(v: IVector3): void; /** * Multiply the given Quaternion with this vector. * * @param q - The quaternion to multiply with. */ multiplyQuaternion(q: IQuaternion): void; /** * Clone a copy of this vector. * * @returns The cloned vector. */ clone(): Vector3; }