Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2357x 2357x 2357x 2357x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1765x 15x 1765x 1765x 1x 15x 15x 15x 15x 15x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1750x 2x 1750x 1750x 1x 2x 2x 2x 2x 2x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 9x 9x 9x 9x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 2x 2x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 50x 50x 50x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 244x 244x 244x 1x 1x 1x 1x 1x 1x 1x 63x 63x 63x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 6x 6x 6x 6x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 39x 39x 39x 39x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 53x 53x 53x 53x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1769x 3x 1769x 1769x 1x 3x 3x 3x 3x 3x 3x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | /*----------------------------------------------------------------------+
| Line construction classes — extracted from Constructions.ts |
| Each class maps a (type, constructionName, signature) triple to |
| a construct() method that creates the geometry element. |
+----------------------------------------------------------------------*/
import {Construction, ConstructionSignature, SortedParams, AllConstructions, LineConstructions as LineConstructionsEnum,
GeomElementsForUpdate} from "../Constructions";
import {PointPerpendicular1Construction, PointPerpendicular2Construction,
PointPerpendicular3Construction, PointPerpendicular4Construction,
PointPerpendicular5Construction} from "../point/PointConstructions";
import {GeomElement} from "../GeomElement";
import {CircleElement} from "../circle/CircleElement";
import {PlaneElement} from "../plane/PlaneElement";
import {PointElement} from "../point/PointElement";
import {Layoff} from "../point/Layoff";
import {Foot} from "../point/Foot";
import {PlaneFootElement} from "../point/PlaneFootElement";
import {LineElement} from "./LineElement";
import {Perpendicular} from "./Perpendicular";
import {PlanePerpendicularLine} from "./PlanePerpendicularLine";
import {Bichord} from "./Bichord";
import {Chord} from "./Chord";
import {SimilarElement} from "../point/SimilarElement";
import {ProportionElement} from "../point/ProportionElement";
import {AngleDividerElement} from "../point/AngleDividerElement";
import {MeanProportionalElement} from "../point/MeanProportionalElement";
/**********************
* Element Class Line *
**********************/
// line
// connect
// points A, B
// the line AB connecting two points A and B
// (Java: Slate.java line case 0 — new LineElement(A,B))
export class LineConnectConstruction extends Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.connect;
signature = { points: 2, elements: 0, integers: 0 };
construct(screen : PlaneElement, P: PointElement[], E: GeomElement[], N: number[]): [GeomElementsForUpdate, GeomElement] {
let g = new LineElement({A:P[0], B: P[1]});
return [[g], g];
}
}
// line
// angleBisector — points B, A, C [, plane D = screen]
// line from A to the bisector point of angle BAC on line BC
// 2D: 3 points, 0 elements — uses screen plane
// 3D: 3 points, 1 PlaneElement — uses explicit plane
// (Java: Slate.java line case 1 — AngleDivider(B,A,C,plane,2) + LineElement(A,result))
export class AngleBisectorLineConstruction extends Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.angleBisector;
signature: ConstructionSignature = { points: 3, elements: 0, integers: 0 };
public validateSignature(cm: AllConstructions, sp: SortedParams): boolean {
if (cm !== this.constructionMethod) return false;
return sp.P.length === 3 && sp.N.length === 0
&& (sp.E.length === 0 || (sp.E.length === 1 && sp.E[0] instanceof PlaneElement));
}
construct(screen: PlaneElement, P: PointElement[], E: GeomElement[], N: number[]): [GeomElementsForUpdate, GeomElement] {
let plane = E.length > 0 ? E[0] as PlaneElement : screen;
let ad = new AngleDividerElement(P[0], P[1], P[2], plane, 2);
let g = new LineElement({A: P[1], B: ad});
return [[ad, g], g];
}
}
// line
// angleDivider — points B, A, C, integer n [, plane D = screen]
// line from A to the n-th division point of angle BAC on line BC
// 2D: 3 points, 0 elements, 1 integer — uses screen plane
// 3D: 3 points, 1 PlaneElement, 1 integer — uses explicit plane
// (Java: Slate.java line case 2 — AngleDivider(B,A,C,plane,n) + LineElement(A,result))
export class AngleDividerLineConstruction extends Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.angleDivider;
signature: ConstructionSignature = { points: 3, elements: 0, integers: 1 };
public validateSignature(cm: AllConstructions, sp: SortedParams): boolean {
if (cm !== this.constructionMethod) return false;
return sp.P.length === 3 && sp.N.length === 1
&& (sp.E.length === 0 || (sp.E.length === 1 && sp.E[0] instanceof PlaneElement));
}
construct(screen: PlaneElement, P: PointElement[], E: GeomElement[], N: number[]): [GeomElementsForUpdate, GeomElement] {
let plane = E.length > 0 ? E[0] as PlaneElement : screen;
let ad = new AngleDividerElement(P[0], P[1], P[2], plane, N[0]);
let g = new LineElement({A: P[1], B: ad});
return [[ad, g], g];
}
}
// line
// foot (2D variant)
// 3 points A, B, C
// the line AD from A to the foot of the perpendicular from A to line BC
// (Java: Slate.java case 3, choice 0 — Foot(A,B,C) + LineElement(A,foot).
// Foot class already IMPL at src/elements/point/Foot.ts.)
export class LineFootConstruction extends Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.foot;
signature = { points: 3, elements: 0, integers: 0 };
construct(screen : PlaneElement, P: PointElement[], E: GeomElement[], N: number[]): [GeomElementsForUpdate, GeomElement] {
let fo = new Foot(P[0], P[1], P[2]);
let g = new LineElement({A: P[0], B: fo});
return [[fo, g], g];
}
}
// *Solid Geometry Only*
// line
// foot
// point A plane B
// the line AD drawn perpendicular to plane B with the point D lying on B
// (Java: PlaneFoot.java — TS: PlaneFootElement.ts, renamed for clarity)
export class PlaneFootLineConstruction extends Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.foot;
signature = { points: 1, elements: 1, integers: 0, elementTypes: [PlaneElement] };
construct(_screen: PlaneElement, P: PointElement[], E: GeomElement[], N: number[]): [GeomElementsForUpdate, GeomElement] {
const fo = new PlaneFootElement(P[0], E[0] as PlaneElement);
const g = new LineElement({A: P[0], B: fo});
return [[fo, g], g];
}
}
// line
// chord
// points A, B, circle C
// the chord of circle C cut by the line AB
// (post-LineElement-expansion: A, B are the two endpoints of the input line)
// (Java: Slate.java line case 4 — new Chord(A,B,C). Java: Chord.java)
export class ChordConstruction extends Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.chord;
signature = { points: 2, elements: 1, integers: 0, elementTypes: [CircleElement] };
construct(screen : PlaneElement, P: PointElement[], E: GeomElement[], N: number[]): [GeomElementsForUpdate, GeomElement] {
const g = new Chord({D: P[0], E: P[1], C: E[0] as CircleElement});
return [[g], g];
}
}
// line
// bichord
// circles A, B
// the common chord connecting the two intersection points of the circles A and B
// (Java: Slate.java line case 5 — new Bichord(A,B). Java: Bichord.java)
export class BichordConstruction extends Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.bichord;
signature = { points: 0, elements: 2, integers: 0, elementTypes: [CircleElement, CircleElement] };
construct(screen : PlaneElement, P: PointElement[], E: GeomElement[], N: number[]): [GeomElementsForUpdate, GeomElement] {
let g = new Bichord({C: E[0] as CircleElement, D: E[1] as CircleElement});
return [[g], g];
}
}
// Line perpendicular constructions — all 5 variants share the same
// construct() pattern: call the parent point-perpendicular construct(),
// then return the Perpendicular LineElement (first in elementsForUpdate).
// (Java: Slate.java line case 6 — all choices dispatch to a Perpendicular
// or PlanePerpendicular, then return the LineElement directly.)
function wrapPointAsLine(es: [GeomElementsForUpdate, GeomElement]): [GeomElementsForUpdate, GeomElement] {
return [es[0], es[0][0]];
}
// line — perpendicular variant 1: points A, B [plane C (screen)]
// the line from A to the point D so that AD is equal and perpendicular to AB in plane C
// (Java: Slate.java line case 6, choice 0 — Perpendicular(A,B,screen,A,B))
export class LinePerpendicular1Construction extends PointPerpendicular1Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.perpendicular;
construct(screen: PlaneElement, P: PointElement[], E: GeomElement[], N: number[]) { return wrapPointAsLine(super.construct(screen, P, E, N)); }
}
// line — perpendicular variant 2: points A, B, plane C
// (Java: Slate.java line case 6, choice 1 — Perpendicular(A,B,C,A,B))
export class LinePerpendicular2Construction extends PointPerpendicular2Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.perpendicular;
construct(screen: PlaneElement, P: PointElement[], E: GeomElement[], N: number[]) { return wrapPointAsLine(super.construct(screen, P, E, N)); }
}
// line — perpendicular variant 3: points A, B, D, E [plane C (screen)]
// (Java: Slate.java line case 6, choice 2 — Perpendicular(A,B,screen,D,E))
export class LinePerpendicular3Construction extends PointPerpendicular3Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.perpendicular;
construct(screen: PlaneElement, P: PointElement[], E: GeomElement[], N: number[]) { return wrapPointAsLine(super.construct(screen, P, E, N)); }
}
// line — perpendicular variant 4: points A, B, plane C, points D, E
// (Java: Slate.java line case 6, choice 3 — Perpendicular(A,B,C,D,E))
export class LinePerpendicular4Construction extends PointPerpendicular4Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.perpendicular;
construct(screen: PlaneElement, P: PointElement[], E: GeomElement[], N: number[]) { return wrapPointAsLine(super.construct(screen, P, E, N)); }
}
// line — perpendicular variant 5: point A, plane B, points C, D
// (Java: Slate.java line case 6, choice 4 — PlanePerpendicularLine(A,B,C,D))
export class LinePerpendicular5Construction extends PointPerpendicular5Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.perpendicular;
construct(screen: PlaneElement, P: PointElement[], E: GeomElement[], N: number[]) { return wrapPointAsLine(super.construct(screen, P, E, N)); }
}
// line
// cutoff
// points A, B, C, D
// the line AE equal to CD along the line AB
// (Java: Slate.java line case 7 — Layoff(A,A,B,C,D) + LineElement(A,layoff))
export class LineCutoffConstruction extends Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.cutoff;
signature = { points: 4, elements: 0, integers: 0 };
construct(screen : PlaneElement, P: PointElement[], E: GeomElement[], N: number[]): [GeomElementsForUpdate, GeomElement] {
let lo = new Layoff(P[0], P[0], P[1], P[2], P[3]);
let g = new LineElement({A: P[0], B: lo});
return [[lo, g], g];
}
}
// line
// extend
// points A, B, C, D
// the line BE equal to CD so that A, B, and C are collinear with B between A and C
// (Java: Slate.java line case 8 — Layoff(B,A,B,C,D) + LineElement(B,layoff))
export class LineExtendConstruction extends Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.extend;
signature = { points: 4, elements: 0, integers: 0 };
construct(screen : PlaneElement, P: PointElement[], E: GeomElement[], N: number[]): [GeomElementsForUpdate, GeomElement] {
let lo = new Layoff(P[1], P[0], P[1], P[2], P[3]);
let g = new LineElement({A: P[1], B: lo});
return [[lo, g], g];
}
}
// line
// parallel
// points A, B, C
// the line AD through A parallel and equal to BC, so D = A + (C - B)
// (no dedicated Java class — Slate.java case 9 dispatches to a Layoff
// trick: Layoff(A, B, C, B, C) gives D = A + (C-B), then wraps a fresh
// LineElement(A, D). Same pattern as LineExtendConstruction above.)
export class LineParallelConstruction extends Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.parallel;
signature = { points: 3, elements: 0, integers: 0 };
construct(screen : PlaneElement, P: PointElement[], E: GeomElement[], N: number[]): [GeomElementsForUpdate, GeomElement] {
let lo = new Layoff(P[0], P[1], P[2], P[1], P[2]);
let g = new LineElement({A: P[0], B: lo});
return [[lo, g], g];
}
}
// line
// similar — points A, B, D, E, F [, planes C, G = screen]
// the line AH so that triangle ABH is similar to triangle DEF
// 2D: 5 points, 0 elements — uses screen plane for both
// 3D: 5 points, 2 PlaneElements — uses explicit planes
// (Java: Slate.java line case 10 — Similar(A,B,C,D,E,F,G) + LineElement(A,H))
export class SimilarLineConstruction extends Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.similar;
signature: ConstructionSignature = { points: 5, elements: 0, integers: 0 };
public validateSignature(cm: AllConstructions, sp: SortedParams): boolean {
if (cm !== this.constructionMethod) return false;
return sp.P.length === 5 && sp.N.length === 0
&& (sp.E.length === 0 || sp.E.length === 2);
}
construct(screen: PlaneElement, P: PointElement[], E: GeomElement[], N: number[]): [GeomElementsForUpdate, GeomElement] {
let c = E.length > 0 ? E[0] as PlaneElement : screen;
let g2 = E.length > 1 ? E[1] as PlaneElement : screen;
let sim = new SimilarElement(P[0], P[1], c, P[2], P[3], P[4], g2);
let g = new LineElement({A: P[0], B: sim});
return [[sim, g], g];
}
}
// line
// proportion
// 8 points A, B, C, D, E, F, G, H
// the line GI along GH so that AB:CD = EF:GI
// (Java: Slate.java line case 11 — Proportion + LineElement(G, result))
export class ProportionLineConstruction extends Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.proportion;
signature = { points: 8, elements: 0, integers: 0 };
construct(screen: PlaneElement, P: PointElement[], E: GeomElement[], N: number[]): [GeomElementsForUpdate, GeomElement] {
let prop = new ProportionElement(P[0], P[1], P[2], P[3], P[4], P[5], P[6], P[7]);
let g = new LineElement({A: P[6], B: prop});
return [[prop, g], g];
}
}
// line
// meanProportional
// 6 points S0, S1, T0, T1, U0, U1
// the line U0U' along U0U1 so that S:U' = U':T
// (Java: Slate.java line case 12 — MeanProportional + LineElement(U0, result))
export class MeanProportionalLineConstruction extends Construction {
constructionMethod: AllConstructions = LineConstructionsEnum.meanProportional;
signature = { points: 6, elements: 0, integers: 0 };
construct(screen : PlaneElement, P: PointElement[], E: GeomElement[], N: number[]): [GeomElementsForUpdate, GeomElement] {
let mp = new MeanProportionalElement(P[0], P[1], P[2], P[3], P[4], P[5]);
let g = new LineElement({A: P[4], B: mp});
return [[mp, g], g];
}
}
export const lineConstructions: Construction[] = [
new LineConnectConstruction(),
new LineExtendConstruction(),
new LinePerpendicular1Construction(),
new LinePerpendicular2Construction(),
new LinePerpendicular3Construction(),
new LinePerpendicular4Construction(),
new LinePerpendicular5Construction(),
new BichordConstruction(),
new ChordConstruction(),
new LineParallelConstruction(),
new LineCutoffConstruction(),
new PlaneFootLineConstruction(),
new LineFootConstruction(),
new SimilarLineConstruction(),
new ProportionLineConstruction(),
new AngleBisectorLineConstruction(),
new AngleDividerLineConstruction(),
new MeanProportionalLineConstruction(),
];
|