For Programmers: Free Programming Magazines  


Home > Archive > Clarion > May 2006 > Math, Degrees & Clarion









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Math, Degrees & Clarion
James

2006-05-18, 6:55 pm

Does anyone have any idea how to handle math expressions with degrees
using CW5.5?

I cannot find anything in the CW documentation that makes any reference
to handling degrees.

Below is an example of a math statement, representative of formulas
that use two sets of values in degrees. In CW, what conversion formula
could I use to get CW to produce the same math result?

EXAMPLE:

292.797297526=3D292.411=B0+1.915=B0*(sin(011.401=B0))+0.020=B0*(sin(2*011.4=
01=B0))


LOC:RESULT=3DLOC:VARA+1.915=B0*(sin(LOC:VARB))+0.020=B0*(sin(2*LOC:VARB))

Expressing 1.915 degrees and 0.020 degrees in some other form
compatible with CW math functions seem to be the issue. All of the
other sets of numbers are local variables that I put values to for the
sake of clarity.

I've been playing with 57.3 (180 degrees divided by PI as a direction
for a solution) but I'm still not getting the math to justify with the
known result (292.797297626).

Any ideas? Thanks!

sandinzz@yahoo.com

2006-05-19, 7:55 am

Maybe this value will help you.
PI EQUATE(3.1415926535898) !The value of PI

Leonid Chudakov

2006-05-19, 6:55 pm

Hi,

Try

LOC:VARA REAL
LOC:VARB REAL
CODE
LOC:VARA = 292.411
LOC:VARB = 11.401
LOC:RESULT=LOC:VARA+1.915*(sin(LOC:VARB/57.3))+0.020°*(sin(2*LOC:VARB/57.3))
--
Leonid Chudakov
chudakov@klarisoft.com
Cool tools and Clarion examples at
http://www.klarisoft.com


"James" <james@jamesarnett.com> wrote in message
news:1147989016.382353.99300@i39g2000cwa.googlegroups.com...
Does anyone have any idea how to handle math expressions with degrees
using CW5.5?

I cannot find anything in the CW documentation that makes any reference
to handling degrees.

Below is an example of a math statement, representative of formulas
that use two sets of values in degrees. In CW, what conversion formula
could I use to get CW to produce the same math result?

EXAMPLE:

292.797297526=292.411°+1.915°*(sin(011.401°))+0.020°*(sin(2*011.401°))


LOC:RESULT=LOC:VARA+1.915°*(sin(LOC:VARB))+0.020°*(sin(2*LOC:VARB))

Expressing 1.915 degrees and 0.020 degrees in some other form
compatible with CW math functions seem to be the issue. All of the
other sets of numbers are local variables that I put values to for the
sake of clarity.

I've been playing with 57.3 (180 degrees divided by PI as a direction
for a solution) but I'm still not getting the math to justify with the
known result (292.797297626).

Any ideas? Thanks!


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com