[fixed] Reflect[<Object>, <Plane>] not working with JS

MiroFrey shared this problem 6 years ago
Answered

Hello,

The following minimal example using this js code

    command = "Reflect[A, mirror]";

    ggbApplet.evalCommand(command);

fails to execute when hitting the button. mirror is a plane spanned by 3 points. A is some point (not included in the plane).

The error reads:

Command Reflect:

Illegal Argument: Plane mirror


Syntax:

Reflect.syntax


Using the inputline one can easily write 'Reflect[A,mirror]' and get the expected mirrored A'.


Since this totally messes up my expectiations how js is handled when using ggbApplet.evalCommand() I can't make any further suggestions how to solve this.

https://ggbm.at/1714817

Comments (4)

photo
1

Does it work if you use the Mirror[] for the command name rather than Reflect[]

photo
1

Does it work if you use the Mirror[] for the command name rather than Reflect[]


I`m feeling a bit stupid now... It actually does work for the point. and also for other objects (tested with plane since I will need it later on).with Mirror[]

Thanks for the fast answer. Though this is still strange because I don't get a Mirror[] command in autocompletion when typing it in the console. Yet it does work if I fully write it out...

photo
1

I`m feeling a bit stupid now...

You shouldn't :) Some commands in GGB have two names (current and compatibility name from before it was renamed) andfor some of those only the compatibility name worked properly in scripting (until now). Since next release Reflect will also work in scripts with 3D.

photo
1

New version 5.0.156.0 now online with this fixed!

© 2022 International GeoGebra Institute