/** A body as the camera sees it: the unit direction to its centre, whether the camera is inside it, and the cosine of its angular radius. */ export interface CoverBody { dx: number; dy: number; dz: number; inside: boolean; cos: number; } /** * The cover of a body for a camera. * * @param position - The body's centre, x y z. * @param camera - The camera's place, x y z, in the same units. * @param radius - The body's radius, in the same units. * @returns The body as the camera sees it. */ export declare function coverBody(position: readonly number[], camera: readonly number[], radius: number): CoverBody; /** * Whether any of the bodies covers a ray from the camera. * * @param bodies - The bodies, from `coverBody`. * @param x - The ray's direction, x (a unit vector's). * @param y - The ray's direction, y. * @param z - The ray's direction, z. * @returns True where the ray meets a body. */ export declare function covers(bodies: readonly CoverBody[], x: number, y: number, z: number): boolean; /** What `pathOutside` draws with: a canvas's context. */ export interface Path { moveTo(x: number, y: number): void; lineTo(x: number, y: number): void; } /** * Adds a segment to the path, less the part of it a body covers. What a body covers of the picture is convex (a disc, or an ellipse towards the edges of a wide view), so a line meets it once at most: the segment is walked in short steps, and where one step * is covered and the next is not, the edge between them is found by halving. Nothing is made; the path takes the pieces. * * @param path - The path to add the pieces to (a canvas's context). * @param x0 - The segment's start, x. * @param y0 - The start, y. * @param x1 - The end, x. * @param y1 - The end, y. * @param covered - Whether a body covers a point of the picture, or `undefined` where none does. * @param inset - How far, in pixels, a piece is held back from the edge it is cut at: half the line's width and its round end, so the stroke stays off the body. */ export declare function pathOutside(path: Path, x0: number, y0: number, x1: number, y1: number, covered: ((x: number, y: number) => boolean) | undefined, inset?: number): void; /** * Whether any part of a label is on a body: the corners and the middle of the name's edges, the star's own point and eight points of the ring round it, and the end of its leader. * * @param covered - Whether a body covers a point of the picture. * @param left - The name's box, from the picture's top left. * @param top - The box's top. * @param right - The box's right. * @param bottom - The box's bottom. * @param label - The star's label, for its point, ring and leader. * @returns True where some part is over a body. */ export declare function touches(covered: (x: number, y: number) => boolean, left: number, top: number, right: number, bottom: number, label: { x: number; y: number; ring: number; leader?: boolean; leaderX1: number; leaderY1: number; }): boolean; /** * Whether any part of a box is on a body: its corners and the middle of its edges. * * @param covered - Whether a body covers a point of the picture. * @param left - The box's left. * @param top - The top. * @param right - The right. * @param bottom - The bottom. * @returns True where some part is over a body. */ export declare function boxCovered(covered: (x: number, y: number) => boolean, left: number, top: number, right: number, bottom: number): boolean;