Saltire logo CoreGX

Geometry Command Reference

This document describes the syntax of the CoreGX language. The CoreGX language is the declarative command language produced by the LLM. It is not the solver's internal representation. Some commands (segments, congruence, intersection) expand into primitive objects and constraints before solving.

Primitive objects:

General line grammar

Positional arguments vs. options (key=value)

Key Type Description
visible bool Whether the object is drawn at all.
color string Stroke/fill color of the object.
textcolor string Color of any associated label text.
font string Font used for label text.
textsize int Size of label text.
linestyle solid | dashed Style of lines, segments, and vectors.
linewidth double Stroke width for lines, segments, vectors, and circles.
pointwidth double Diameter of point markers.
width double
arrowstyle none | end Whether an arrowhead is drawn on a line.
arrowsize double Size of the arrowhead, if drawn.
opacity double Opacity of the object, from 0 (fully transparent) to 1 (fully opaque).
Category Visible Color Text Size Text Color Font Line Style Line Width Point Width Arrow Style Arrow Size Opacity
(struct default) true black 10 black normal solid 1.5 6 none 2 1
point #A463BF
segment #000000 solid 2
line #A0A0A0 dashed 1
vector #000000 solid 2 end
circle #3398DB solid 2
conic #3398DB solid 2
curve red solid 2
constraint gray 1
mechanical #5C8F8D 2

A dash () means the category's default does not explicitly set that field, so it falls back to the struct default in the top row.

point A color=red
point B visible=false

Naming rules

These rules are enforced by CoreGX and will produce errors if violated.

Point names

Segment names

Circle names

All other object names (Vector, locus, envelope, function, conic, transform names)


1. Basic shapes

point

line

line L1 color=gray
line D
reflectiontransform R D
transformimage L2 R L1

segment

segment A B

triangle

triangle A B C color=green

polygon

polygon A B C D

cyclicpolygon

cyclicpolygon C0 O A B C D

vector

vector v A B

2. Circle Constructions

circumcircle

triangle A B C
circumcircle C0 O A B C

incircle

triangle A B C
incircle C0 O U A B C

excircle

triangle A B C
excircle C0 O V A B C

circle

# Circle with a center and circumference point
circle C0 O A
# Circle with just a center point
circle C1 J

3. Derived points and lines

curvetangent

midpoint

segment A B
midpoint N A B

pointonsegment

segment A B
pointonsegment G AB

intersection

segment A B
segment C D
intersection I AB CD

altitude

triangle A B C
altitude E A B C color=blue

project

point P
segment A B
project D P AB

median

triangle A B C
median E A B C

anglebisector

triangle A B C
# bisector at B of triangle ABC
anglebisector L1 A B C
# external bisector at B of triangle ABC
anglebisector L2 A B C external=true

perpendicularbisector

segment A B
perpendicularbisector L1 A B

parallel

polygon A B C D
parallel AB CD
parallel AD BC

congruent

triangle A B C
congruent AB BC

incident

point A
segment B C
incident A BC

tangent

circle C0 O
segment A B
tangent AB C0

4. Relationship constraints

These commands add constraints between already-named objects (segments, lines, circles, points). They do not usually create new points by themselves.

between

clockwise / counterclockwise

perpendicular

sameside / oppositeside

inside / outside

insidetriangle

circleinside / circleoutside / circleoverlaps

convex

concave

A concave kite:

polygon A B C D
congruent AB BC
congruent CD DA
concave A B C D

acute

obtuse


5. Numeric and equation constraints

These commands take expression strings. If an argument contains spaces or =, quote it.

coordinates

coordinates P 4 6
coordinates R t t^2

coefficients

distance

angle

anglemode degree
segment A B
segment A C
angle B A C 89

radius

slope

line l0
slope l0 1

direction

anglemode degree
line l2
direction l2 120

parametric

segment A B
parametric P AB 0.25

equation

line L
equation L "y=x"
circle C0 O E
equation C0 "(x-1)^2+(y+2)^2=9"

6. Transforms

Transformations are constraints, not constructions. They do not inherently move geometry; instead they express geometric relationships. If a transformation depends on a parameter, then applying it to an object produces parameter-dependent geometry, which may be used in locus or envelope constructions, or animations. Motion arises only when a parameter varies; transformations themselves do not define motion.

reflectiontransform

rotationtransform

dilationtransform

translationtransform

vector v A B
point C
translationtransform T v
transformimage C T B

transformimage


7. Curves: locus, envelope, function

locus

point A
coordinates A xA yA

Fixed objects must not be given numeric coordinates unless the user explicitly specifies them.

envelope

family

function

function g f(x)

polarfunction

parametriccurve


8. Variables and animation

animate

value


9. Conics

ellipse

hyperbola

parabola


10. Meta Commands

anglemode

arbitrarypoints

defaultproperties

definefunction

displayproperties

vector v A B
point C
displayproperties v C color=blue

measure

triangle A B C
distance A B c
distance A C b
distance B C a
measure area(A,B,C)
measure distance(A,BC)
measure "distance(A,BC)*distance(B,AC)*distance(C,AB)"

Supported geometry functions:

Function Description
angle(A,B,C) Angle ABC
angle(AB,CD) Angle between segments AB and CD
angle(L0,AB) Angle between line L0 and segment AB
angle(L0,L1) Angle between lines L0 and L1
area(A,B,C,D) Area of polygon ABCD
area(C0) Area of circle C0
coefficients(AB) Coefficients of vector AB
coordinates(A) Coordinates of point A
direction(A,B) Slope of a line from A to B
direction(AB) Slope of segment AB
direction(L0) Slope of line L0
distance(A,B) Distance from point A to point B
distance(A,BC) Perpendicular distance from point A to segment BC
distance(A,L0) Perpendicular distance from point A to line L0
equation(AB) Equation of the line AB
equation(L0) Equation of line L0
equation(C0) Equation of circle C0
equation(K0) Equation of curve K0
length(AB) Length of segment AB
parametricequations(AB) Parametric equations of line AB
parametricequations(L0) Parametric equations of line L0
parametricequations(C0) Parametric equations of circle C0
parametricequations(K0) Parametric equations of curve K0
perimeter(A,B,C,D) Perimeter of polygon ABCD
perimeter(C0) Perimeter of circle C0
radius(C0) Radius of circle C0
slope(A,B) Slope of a line from A to B
slope(AB) Slope of segment AB
slope(L0) Slope of line L0

Supported engineering functions:

Function Description
centroid(A,B,C,D) Centroid of polygon ABCD
Ix(A,B,C,D) Area moment of inertia about axis through centroid, parallel to x-axis
Ixy(A,B,C,D) Area product of inertia about the centroid
Iy(A,B,C,D) Area moment of inertia about axis through centroid, parallel to y-axis

Measurement expressions may also use standard math functions (sin, cos, tan, arcsin, arccos, arctan, sinh, cosh, tanh, sqrt, abs, signum, exp, log, ln, ceil, floor) and arithmetic operators to form compound expressions such as distance(A,BC)*distance(B,AC)*distance(C,AB).

viewbox