Properties
Similar Topics
Statistics
Comments
2
Participants
3
Subscribers
3
Votes
1
Views
495
Share

Issue with changing the value of a Vector with GeoGebra Script
Answered
Hello
I am trying to set the value of a vector based on some condition with
If(dot > 0.8, SetValue[u,(0,0,1)], SetValue[u,(0,1,0)])
in the On Update tab (A). However, if the value of dot changes, nothing happens.
You find my sample project here: https://www.geogebra.org/3d...
Looking forward for your help, Samuel
- GeoGebra
- Help
- Partners
-
Contact us
- Feedback & Questions
- This email address is being protected from spambots. You need JavaScript enabled to view it.
- +43 677 6137 2693
© 2023 International GeoGebra Institute
SetValue(u, If(dot>0.8, (0, 0 ,1),(0, 1, 0))) works as On Update script.
chris
Your definition of u should be as follows:
u=(0,1,0)
Note: the lower-case name (at first definition) determines that it is a vector
Both your syntax and the syntax of chris lead to the desired result.
----------------------------------------------------------------------
u=Vector((0,1,0))
is a dependent object. These cannot be changed with SetValue().
Comments have been locked on this page!