Home   Help Search Login Register  

Author Topic: Cos Tan Issue.. maybe OFPR BUG?!?!  (Read 734 times)

0 Members and 1 Guest are viewing this topic.

Offline Flauta

  • Members
  • *
  • There is no knownledge, that is no power
    • Chek mi FLog
Cos Tan Issue.. maybe OFPR BUG?!?!
« on: 04 Apr 2005, 22:24:27 »
well actuali I was working in a Script.. not really for ofpr... jjeeje just to do more Easly mi Matts Homework...
i it is about all the Sin Cos Tan thing.. but in in a special case  I have a rare error!! not really sure wy this happen... maybe I have a Grammar mistake.. or mi Matts arent really good...
well this is the script wich has a rarely malfuction...
Code: [Select]
;tarea de MAtematicas "sohCahToa.sqs"
;NOTE Change the X for a 0
;And the _line must be Adyasent to the Angle
;it still Beta....
;use like this: [Catet,Hipotenusa,Angle] exec "sohcahtoa.sqs"
Hint "Executing..."

_arr = count _this
? _arr == 3 : goto "SohCahToa"
? _arr == 4 : goto "inverse"

? _arr <= 1 : hint "Error 001: Parametros mal definidos"; exit
? _arr > 4 : hint "Error 002: Demasiados Parametros"; exit


#SohCahToa


_Hip = _this select 0
_linea =_this select 1
_angulo1 =_this select 2

? _hip == 0 : Goto "toa"
? _linea == 0 : Goto "SohCah"
hint "Error 003: Algo esta mal definido"
exit

#toa

hint "Cargados: 3 Elementos (SohCahToa)\n Calculando Hipotenusa"
~1
[b];Problem starts here[/b]
_ncos = cos _angulo1
_rcos = _linea / _rcos

_ntan = tg _angulo1
_rtan = _ntan * _linea

hintC format ["Operacion Realizada:(Angulo %1)\nCateto Adyasente:%2\nCateto Opuesto %3\nHipotenusa %4\n\nTan:%4 Cos:%6",_angulo1,_linea,_rtan,_rcos,_ntan,_ncos]

[b];Problem ends here[/b]

Exit

#sohCah

hint "Cargados: 3 Elementos (SohCahToa)\n Calculando Catetos"
~1
_ncos = cos _angulo1
_ncos2 = sin _angulo1
_rcos = _ncos * _Hip
_rcos2 = _ncos2 * _Hip

hintC format ["Operacion Realizada:(Angulo %1)\nCateto Adyasente:%2\nCateto Opuesto:%3\nHipotenusa %4\n\nCos: %5 Sen: %6",_angulo1,_rcos,_rcos2,_Hip,_ncos,_ncos2]

Exit

#inverse
hint "Cargados: 4 Elementos (Asen Acos Atan)\nEn Construccion"
exit

and the problem is when_linea = 0

is in Spanish.. but I dont think this will be aproblem

Offline Pilot

  • Contributing Member
  • **
Re:Cos Tan Issue.. maybe OFPR BUG?!?!
« Reply #1 on: 05 Apr 2005, 04:59:45 »
Hey Flauta,

Do you get an error message?  If you do, please post it.

The only possible problem I see is this:
Quote
_rcos = _linea / _rcos
You are saying _rcos is equal to _linea divided by _rcos.
_rcos is not defined anywhere else, so you are dividing _linea by an undefined variable.  This might be causing a problem.

Offline Flauta

  • Members
  • *
  • There is no knownledge, that is no power
    • Chek mi FLog
Re:Cos Tan Issue.. maybe OFPR BUG?!?!
« Reply #2 on: 06 Apr 2005, 01:59:50 »
well, that whas an little writing error... but the problem sill's there, the Hipotenuse  take the same number of the Tan one... did U tried the script?

Offline Pilot

  • Contributing Member
  • **
Re:Cos Tan Issue.. maybe OFPR BUG?!?!
« Reply #3 on: 06 Apr 2005, 02:56:41 »
No, I haven't tried it yet.

Offline Pilot

  • Contributing Member
  • **
Re:Cos Tan Issue.. maybe OFPR BUG?!?!
« Reply #4 on: 06 Apr 2005, 04:50:16 »
Hey Flauta,

I think I have found another problem, this time in this line:
Quote
hintC format ["Operacion Realizada:(Angulo %1)\nCateto Adyasente:%2\nCateto Opuesto %3\nHipotenusa %4\n\nTan:%4 Cos:%6",_angulo1,_linea,_rtan,_rcos,_ntan,_ncos]
You have this:
Code: [Select]
Hipotenusa %4And this:
Quote
Tan:%4
In your hint, you are assigning the hypotenuse and tangent the same value, change the line to this:
Quote
hintC format ["Operacion Realizada:(Angulo %1)\nCateto Adyasente:%2\nCateto Opuesto %3\nHipotenusa %4\n\nTan:%5 Cos:%6",_angulo1,_linea,_rtan,_rcos,_ntan,_ncos]

Offline Flauta

  • Members
  • *
  • There is no knownledge, that is no power
    • Chek mi FLog
Re:Cos Tan Issue.. maybe OFPR BUG?!?!
« Reply #5 on: 08 Apr 2005, 01:23:09 »
jojo Great!!!! pilot thanks 4 your time!!!!, that was wholle problem.. just writing problems.. I must write more carefully! I cant belive that it was the problem!

thanks alot!

Flauta

Note: I Think the problem is solved.. but I cant test it yet... I'll solve it when I be sure
Keep Commenting!!! and someone else! poor Pilot!