jakke-graphics-ts
Version:
My common graphics utils for building my aec apps.
52 lines • 2.07 kB
TypeScript
import { Line, Vertex2d, Vertex3d } from "../models/types/basicGeometries";
declare function add(v0: Vertex3d, v1: Vertex3d): Vertex3d;
declare function rotateOnXY(v: Vertex3d, rad: number): Vertex3d;
declare function rotateOnYZ(v: Vertex3d, rad: number): Vertex3d;
declare function rotateOnXZ(v: Vertex3d, rad: number): Vertex3d;
declare function subtract(v0: Vertex3d, v1: Vertex3d): Vertex3d;
declare function scale(v: Vertex3d, scalar: number): Vertex3d;
declare function dot(v0: Vertex3d, v1: Vertex3d): number;
declare function cross(v0: Vertex3d, v1: Vertex3d): Vertex3d;
declare function normalize(v: Vertex3d): Vertex3d;
declare function flip(v: Vertex3d): Vertex3d;
declare function isParallel(v0: Vertex3d, v1: Vertex3d): boolean;
declare function isParallelLines(li0: Line, li1: Line): boolean;
declare function getSize(v: Vertex3d): number;
declare function getDist(v0: Vertex3d, v1: Vertex3d): number;
declare function is2d(v: Vertex2d | Vertex3d): boolean;
declare function to3d(v: Vertex2d): Vertex3d;
declare function chain(initial: Vertex3d): VectorChain;
interface VectorChain {
add(v: Vertex3d): VectorChain;
subtract(v: Vertex3d): VectorChain;
scale(scalar: number): VectorChain;
normalize(): VectorChain;
dot(v: Vertex3d): number;
cross(v: Vertex3d): VectorChain;
value(): Vertex3d;
flip(): VectorChain;
rotateOnXY(rad: number): VectorChain;
rotateOnYZ(rad: number): VectorChain;
rotateOnXZ(rad: number): VectorChain;
}
export declare const VectorUtils: {
add: typeof add;
subtract: typeof subtract;
scale: typeof scale;
dot: typeof dot;
cross: typeof cross;
normalize: typeof normalize;
flip: typeof flip;
isParallel: typeof isParallel;
isParallelLines: typeof isParallelLines;
getSize: typeof getSize;
getDist: typeof getDist;
rotateOnXY: typeof rotateOnXY;
rotateOnYZ: typeof rotateOnYZ;
rotateOnXZ: typeof rotateOnXZ;
is2d: typeof is2d;
to3d: typeof to3d;
chain: typeof chain;
};
export {};
//# sourceMappingURL=vectorUtils.d.ts.map