Can I define my own commands in GeoGebra script?

41 Views Asked by At

I am brand new to GeoGebra and am trying to write a simple visualization. I have a collection of vectors and I want to change the formatting depending on the value of a dot product. I am currently doing so with the following code:

If(abs(Dot(EqmDir,Fad))<0.1,SetColor(Fad,red),SetColor(Fad, darkgreen))
If(abs(Dot(EqmDir,Fbd))<0.1,SetColor(Fbd,red),SetColor(Fbd, darkgreen))
If(abs(Dot(EqmDir,Fcd))<0.1,SetColor(Fcd,red),SetColor(Fcd, darkgreen))

but I hate having so much copy and paste. I wish I could write a command called FormatMyVector so that the above code would be replaced with:

FormatMyVector(Fad)
FormatMyVector(Fbd)
FormatMyVector(Fcd)

Does GeoGebra support that kind of programming?

I tried Googling around to figure this out, but either it isn't possible, or I'm not finding the right collection of terms to search for.

0

There are 0 best solutions below