import { TransformN } from '../math/transform.js'; import type { VecN } from '../math/vecn.js'; import type { HomogeneousProjection } from '../projection/types.js'; import { type CoordinateConstraintConsistency, type CoordinateConstraintDetermination } from './coordinate-constraints.js'; import { type AvailableSourceEdgeProjectionFitN, type SourceEdgeCoordinateN, type SourceEdgeProjectionFitFailureReason } from './source-edge-coordinate.js'; import type { SourceCellReferenceN } from './source-reference.js'; export interface SourceEdgeProjectionObservationN { /** Optional stable identity for incremental observation composition. */ readonly key?: string; readonly projection: HomogeneousProjection; readonly targetPoint: readonly [number, number, number]; /** Positive influence in the source-parameter least-squares objective. */ readonly weight?: number; /** Optional caller-owned diagnostic label. */ readonly label?: string; } export interface SourceEdgeObservationFitOptions { /** One source-local to ambient transform shared by every observation. */ readonly transform?: TransformN; /** Scale-relative representation and parameter tolerance. Default `1e-9`. */ readonly tolerance?: number; /** Relative singular-value rank tolerance. Default `1e-10`. */ readonly rankTolerance?: number; } export interface SourceEdgeObservationDiagnosticN { readonly key: string; readonly label?: string; readonly weight: number; readonly targetPoint: readonly [number, number, number]; /** Closest independently inferred edge parameter for this observation. */ readonly observedParameter: number; /** Consensus minus independently inferred source parameter. */ readonly parameterResidual: number; /** Projection of the reconciled source coordinate in this view. */ readonly representationPoint: readonly [number, number, number]; readonly representationResidual: number; /** The complete independently fitted observation for audit. */ readonly independentFit: AvailableSourceEdgeProjectionFitN; } export interface AvailableSourceEdgeObservationFitN { /** Exact only when every target is exact and all infer the same parameter. */ readonly kind: 'exact' | 'least-squares'; /** Whether the independently inferred source parameters agree. */ readonly consistency: CoordinateConstraintConsistency; readonly determination: CoordinateConstraintDetermination; readonly coordinate: SourceEdgeCoordinateN; readonly point: VecN; readonly ambientPoint: VecN; readonly observations: readonly SourceEdgeObservationDiagnosticN[]; readonly totalWeight: number; readonly sourceDegreesOfFreedom: 1; readonly observationRank: number; readonly unresolvedDegreesOfFreedom: number; readonly rankConditioning: number; readonly constraintNormalResidual: number; readonly sourceParameterSpread: number; readonly parameterRmsResidual: number; readonly representationRmsResidual: number; readonly maxRepresentationResidual: number; } export interface UnavailableSourceEdgeObservationFitN { readonly kind: 'unavailable'; readonly reason: 'no-observations' | 'observation-unavailable'; readonly observationIndex?: number; readonly observationReason?: SourceEdgeProjectionFitFailureReason; } export type SourceEdgeObservationFitN = AvailableSourceEdgeObservationFitN | UnavailableSourceEdgeObservationFitN; /** * Reconcile several R3 observations of one explicitly named source edge. * * Each observation first performs the auditable homogeneous single-view fit. * Those fits produce estimates of the same dimensionless source parameter * `t`. The returned coordinate minimizes * * sum(weight[i] * (t - observedT[i])^2) * * on the closed source segment. This is deliberately a source-coordinate * consensus policy, not a claimed inverse of the projections and not an * unlabelled mixture of representation-space units. */ export declare function fitSourceEdgeCoordinateToObservationsN(reference: SourceCellReferenceN, observations: readonly SourceEdgeProjectionObservationN[], options?: SourceEdgeObservationFitOptions): SourceEdgeObservationFitN; //# sourceMappingURL=source-edge-observations.d.ts.map