import { ops, scalar, scalarExt, has } from './core'; import complex from './complex'; import { PolynomialN } from './polynomial'; import { Blade } from './kvector'; export { Blade } from './kvector'; export declare const E2: readonly ["x", "y"]; export type E2 = typeof E2[number]; export declare const E3: readonly ["x", "y", "z"]; export type E3 = typeof E3[number]; export declare const E4: readonly ["x", "y", "z", "w"]; export type E4 = typeof E4[number]; export declare const E5: readonly ["x", "y", "z", "w", "c5"]; export type E5 = typeof E5[number]; export declare const E6: readonly ["x", "y", "z", "w", "c5", "c6"]; export type E6 = typeof E6[number]; export type vec = { [K in E]: T; }; export declare function vec(e: readonly E[], ...v: T[]): vec; type vecKeys = { [K in keyof V]: V[K] extends T ? K : never; }[keyof V] & string; type swiz2 = { [K in `${E}${E}`]: T2; }; type swiz3 = swiz2 & { [K in `${E}${E}${E}`]: T3; }; type swiz4 = swiz3 & { [K in `${E}${E}${E}${E}`]: T4; }; export interface vops, S = any> extends ops { create(...args: S[]): C; _values: S[]; dup(): C; abs(): C; min(b: C): C; max(b: C): C; eq(b: C): boolean; dot(b: C): S; perp(): C; lensq(): S; len(): S; mag(): number | scalarExt; selfScale(b: S): void; selfMul(b: C): void; selfAdd(b: C): void; selfSub(b: C): void; clamp(min: C, max: C): C; } type scalarOf = C extends vops ? S : number; export type vector = vec & vops, S>; export declare function vector(e: readonly E[], ...v: number[]): vector; export declare class vecImp implements vops, number> { constructor(v: vec); private keys; private entries; private asVec; create(...args: number[]): vector; get _values(): number[]; dup(): vector; neg(): vector; abs(): vector; scale(b: number): vector; mul(b: vector): vector; div(b: vector): vector; add(b: vector): vector; sub(b: vector): vector; min(b: vector): vector; max(b: vector): vector; eq(b: vector): boolean; dot(b: vector): number; perp(): vector; lensq(): number; len(): number; mag(): number; selfScale(b: number): void; selfMul(b: vector): void; selfAdd(b: vector): void; selfSub(b: vector): void; clamp(min: vector, max: vector): vector; cross(b: vector): number | Blade | vector; toString(): string; } export type vscalar, S = number> = scalar & has<'sqrt'> & has<'recip'>; export declare function vectorT, E extends string>(e: readonly E[], ...v: T[]): vector; export declare class vecImpT, E extends string> implements vops, T> { constructor(v: vec); private keys; private entries; private asVec; create(...args: T[]): vector; get _values(): T[]; dup(): vector; neg(): vector; abs(): vector; scale(b: T): vector; mul(b: vector): vector; div(b: vector): vector; add(b: vector): vector; sub(b: vector): vector; min(b: vector): vector; max(b: vector): vector; eq(b: vector): boolean; dot(b: vector): T; perp(): vector; lensq(): T; len(): any; mag(): any; selfScale(b: T): void; selfMul(b: vector): void; selfAdd(b: vector): void; selfSub(b: vector): void; clamp(min: vector, max: vector): vector; cross(b: vector): T | vector | Blade; toString(): string; } export declare class floatN extends Array implements vops { constructor(...args: number[]); create(...args: number[]): floatN; get _values(): number[]; static from | ArrayLike>(input: T, mapFn?: (v: number, i: number) => number, thisArg?: any): floatN; static zeros(n: number): floatN; static fromArray(v: number[]): floatN; static fromVec(v: vec): floatN; dup(): floatN; neg(): floatN; abs(): floatN; scale(b: number): floatN; mul(b: floatN): floatN; div(b: floatN): floatN; add(b: floatN): floatN; sub(b: floatN): floatN; min(b: floatN): floatN; max(b: floatN): floatN; eq(b: floatN): boolean; dot(b: floatN): number; perp(): floatN; lensq(): number; len(): number; mag(): number; selfScale(b: number): void; selfMul(b: floatN): void; selfAdd(b: floatN): void; selfSub(b: floatN): void; clamp(min: floatN, max: floatN): floatN; toString(): string; } export type ColumnType = vops, S> & vec; export interface matOps, R extends string, S = scalarOf> { create(...cols: C[]): this; columns(): C[]; inverse(): this; det(): S; scale(s: S): mat; add(b: mat): mat; mul(v: vec): C; mul0(v: vec, col: string): C; matmul, any>>(m: M2): mat>; trace(): S; characteristic(): PolynomialN; eigenvalues(): complex[]; } export type mat, R extends string> = matOps & vec; export declare function eigenvalues(A: floatN[]): complex[]; export declare function matClass, R extends string>(): new (cols: vec) => mat; export declare function mat, R extends string>(m: vec): mat; export declare function matmul, R extends string, M2 extends vec, any>>(a: matOps, b: M2): mat>; export declare function matmulExt, R1 extends string, R2 extends string>(a: matOps, b: vec): mat; export declare function mulExt, R extends string>(a: matOps, v: vec): C; declare class extentV> { min: C; max: C; constructor(min: C, max: C); extent(): C; centre(): C; add(p: C): void; combine(b: extentV): void; encompasses(b: extentV): boolean; overlaps(b: extentV): boolean; contains(p: C): boolean; clamp(p: C): C; } export declare function mid>(a: C, b: C): C; export declare function normalise | number, C extends vops>(a: C): C; export declare function project>(a: C, b: C): C; export declare function reflect>(a: C, b: C): C; export declare function lerp>(a: C, b: C, t: number): C; export declare function approx_equal>(a: C, b: C, tol?: number): boolean; export declare function safeNormalise>(a: C): C | undefined; export interface float2 extends vec, swiz2, vops { cross(b: float2): number; atan2(): number; } declare class extent2 extends extentV { static fromCentreExtent(centre: float2, size: float2): extent2; static from>(items: U): extent2; constructor(min?: float2, max?: float2); overlaps(b: extentV): boolean; encompasses(b: extent2): boolean; contains(b: float2): boolean; } export declare const float2: ((x: number, y: number) => float2) & { zero(): float2; cossin(angle: number): float2; translate(z: float2): float2x3; scale(s: { x: number; y: number; } | number): float2x2; rotate(t: number): float2x2; extent: typeof extent2; }; export declare namespace float2 { type extent = extent2; } export declare function sincos_half(sc: float2): float2; export declare function max_circle_point(m: float2x2): float2; export type float2x2 = mat & { mulPos(v: float2): float2; }; export declare const float2x2: ((x: float2, y: float2) => float2x2) & { identity(): float2x2; }; export type float2x3 = mat & { mulPos(v: float2): float2; mulAffine(this: float2x3, b: float2x3 | float2x2): float2x3; }; export declare const float2x3: ((x: float2, y: float2, z: float2) => float2x3) & { identity(): float2x3; }; export interface float3 extends vec, swiz3, vops { cross(b: float3): float3; perpUnit(): float3; } export declare const float3: ((x: number, y: number, z: number) => float3) & { zero(): float3; translate(w: float3): float3x4; scale(s: vec | number): float3x3; extent: { new (min?: float3, max?: float3): { min: float3; max: float3; extent(): float3; centre(): float3; add(p: float3): void; combine(b: extentV): void; encompasses(b: extentV): boolean; overlaps(b: extentV): boolean; contains(p: float3): boolean; clamp(p: float3): float3; }; }; }; export declare namespace float3 { type extent = typeof float3.extent; } export type float3x3 = mat; export declare const float3x3: ((x: float3, y: float3, z: float3) => float3x3) & { identity(): float3x3; basis(dir: float3): float3x3; }; export type float3x4 = mat & { mulPos(v: float3): float3; mulAffine(this: float3x4, b: float3x4 | float3x3): float3x4; }; export declare const float3x4: ((x: float3, y: float3, z: float3, w: float3) => float3x4) & { identity(): float3x4; }; export interface float4 extends vec, swiz4, vops { } export declare const float4: ((x: number, y: number, z: number, w: number) => float4) & { zero(): float4; scale(s: vec | number): float4x4; extent: { new (min?: float4, max?: float4): { min: float4; max: float4; extent(): float4; centre(): float4; add(p: float4): void; combine(b: extentV): void; encompasses(b: extentV): boolean; overlaps(b: extentV): boolean; contains(p: float4): boolean; clamp(p: float4): float4; }; }; }; export declare namespace float4 { type extent = typeof float4.extent; } export type float4x4 = mat; export declare const float4x4: ((x: float4, y: float4, z: float4, w: float4) => float4x4) & { identity(): float4x4; basis(v: float4): float4x4; };