# Annotating multiple angles via GGB script

To explain simply part of a more complex project I have say two groups of 3 points A,B,C and D,E,F and essentially wish to mark the angles ABC, DEF with the angle values via script. Code can be called say from a button.

This simple example can be hard coded as in the first method but is of course tedious for multiple angles.

points={{A,B,C},{D,E,F}}

# This works but is tedious for more than 2 sets of points

Angle(points(1,1),points(1,2),points(1,3))

Angle(points(2,1),points(2,2),points(2,3))

# Because of the way Geogebra scripts work this next attempt only here for illustrative purposes simply duplicates the second point as k is set to 2 on before the angles are evaluated

k=1

Angle(points(k,1),points(k,2),points(k,3))

k=2

Angle(points(k,1),points(k,2),points(k,3))

# So need a loop. This attempt lumps the 2 output angles together in a sequence and doesn't achieve what is needed.

Sequence(Angle(points(k,1),points(k,2),points(k,3)),k,1,2)

Could anyone suggest how the 3rd method or equivalent can be amended to produce the required result?

Also would like to be able to get the point objects from a list.

For example points(1,1) gives the coords of the point named A and not A which I would like to understand how to do.

I also cannot figure how to produce a list like {{A,B,C},{D,E,F} from 2 lists {A,B,C} and {D,E,F}. Whatever I have tried simply gives coordinate lists and not object lists.

Any help with 1 or all of these 3 queries much appreciated.

attached a sample with Execute()

Thank you Rami for taking the time to provide a solution using Execute which works fine.

However it is a hard coded solution which essentially requires each angle being referenced pretty much as my suggested initial attempt with just 2 angles for illustration.

For shapes with multiple angles this is mega tedious and any alteration to the project requires altering the code as well.

That is the problem with GGB scripting - the lack of decent loops.

I decided to use Javascript and the loop structures there make the problem much more tractable.

Thanks again for your input.

I would still like to know how to join object lists {A,B,C} and {D,E,F} to produce {{A,B,C},{D,E,F}} as objects rather than evaluated coordinate lists.

Loading...Comments have been locked on this page!