Question: SIN and COS functions don´t seem to be working in ZB2019

Is there any plan to fix this issue?

Yes, it has been reported to the developers, so hopefully.

yes i reported the bug to Thomas a week ago :slight_smile:

Thanks guys but it seems after the 2019.1 update the bug is still there.

But The screensaver is working great.

In the meantime you can use this:

[RoutineDef,COSINE,
[VarSet,OPP,TAN(angle)]
[If,ABS(angle)<=90,
[VarSet,HYP,SQRT((1^^2)+(OPP^^2))]
,
[VarSet,HYP,-SQRT((1^^2)+(OPP^^2))]
]
[VarSet,COS,1/HYP]
,angle,COS]
[RoutineDef,SINE,
[VarSet,OPP,TAN(angle)]
[If,ABS(angle)>=90,
[VarSet,HYP,-SQRT((1^^2)+(OPP^^2))]
,
[VarSet,HYP,SQRT((1^^2)+(OPP^^2))]
]
[VarSet,SIN,OPP/HYP]
,angle,SIN]

[VarDef,angle,15]
[IButton,“SINE”,
[VarSet,rsl,0]
[RoutineCall,SINE,angle,rsl]
[Note,rsl]
]
[IButton,“COS”,
[VarSet,rsl,0]
[RoutineCall,COSINE,angle,rsl]
[Note,rsl]
]

1 Like

Oh, thanks! . I just created a dll function that makes the rotations in c++ and it’s probably going to be faster than ZScript but that’s a great solution and it’s always better to have zscripts as pure zscripts . Thanks again!

Good news TAN is working.

Yeah, I had attempted this before but was only possible now because I realised TAN was working.
Yeah my issue was also rotation but ended up creating all rotation with just ZScript using these 2 routines.

Man, I need to get into c++, possibilities are endless :slight_smile: