feat: Implement additional Geometry Applet commands toward Book I #45

Merged
glen merged 2 commits from finish_bookI into main 2023-10-22 17:33:02 +00:00
Showing only changes of commit 4a12367c5d - Show all commits

View File

@ -196,6 +196,12 @@ function dispatchJcommand(
Text("${value}", TitlePoint + (2,5))`
'pivot'
return // already handled in postApplets
'align'
console.warn
'Label alignment is not available in GeoGebra'
'translation, as there is no facility for automatically'
'positioning labels. However, they can be dragged manually.'
return
/e\[\d+\]/
num := parseInt(name.slice(2))
{commands, callbacks, parts} :=
@ -592,6 +598,13 @@ classHandler: Record<JoyceClass, ClassHandler> :=
if args.scalar and args.scalar.length
callbacks.push (api: AppletObject) =>
api.setCoords name, ...args.scalar as XYZ
'lineSlider'
pt := args.subpoints
unless pt and pt.length is 2 then return
commands.push `${name} = Point(Line(${pt[0]}, ${pt[1]}))`
if args.scalar and args.scalar.length
callbacks.push (api: AppletObject) =>
api.setCoords name, ...args.scalar as XYZ
'midpoint'
if args.line
commands.push `${name} = Midpoint(${args.line[0]})`