POV-Ray : Newsgroups : povray.advanced-users : hello all can some one help me simplify a formula Server Time
26 Nov 2024 01:37:09 EST (-0500)
  hello all can some one help me simplify a formula (Message 1 to 8 of 8)  
From: Adam Gibbons
Subject: hello all can some one help me simplify a formula
Date: 14 Apr 2001 23:03:35
Message: <3ad90f87@news.povray.org>
hello to all
i know that this dose not have much to do with povray, as it is a maths
question. but i have posed help up on many math message boards and i get on
reply.

basically i would like the following formulas simplified. that is if they
can be simplified.
 can some one please simplify the following equations for me.

m = ( cos (c*(2*pi)/360) * ( cos (b*(2*pi)/360) * x + sin
(b*(2*pi)/360) * ( cos (a*(2*pi)/360) * z + sin (a*(2*pi)/360)*y)) -
sin (c*(2*pi)/360) * (( cos (a*(2*pi)/360) * y - sin
(a*(2*pi)/360)*z)))

n = ( cos (c*(2*pi)/360) * (( cos (a*(2*pi)/360) * y - sin
(a*(2*pi)/360)*z)) + sin (c*(2*pi)/360) * ( cos (b*(2*pi)/360)*(x) +
sin (b*(2*pi)/360) * ( cos (a*(2*pi)/360) * z + sin
(a*(2*pi)/360)*y)))

o = ( cos (b*(2*pi)/360) * ( cos (a*(2*pi)/360) * z + sin
(a*(2*pi)/360)*y) - sin (b*(2*pi)/360)*(x))

please don't post up any bullshit like why do you want to simplify these
formulas it will not make povray any faster. i would just the like the
ensure. thanks a lot for your help it is much appreciated.

Adam


Post a reply to this message

From: Mark Wagner
Subject: Re: hello all can some one help me simplify a formula
Date: 14 Apr 2001 23:21:48
Message: <3ad913cc@news.povray.org>
Adam Gibbons wrote in message <3ad90f87@news.povray.org>...

>m = ( cos (c*(2*pi)/360) * ( cos (b*(2*pi)/360) * x + sin
>(b*(2*pi)/360) * ( cos (a*(2*pi)/360) * z + sin (a*(2*pi)/360)*y)) -
>sin (c*(2*pi)/360) * (( cos (a*(2*pi)/360) * y - sin
>(a*(2*pi)/360)*z)))
>
>n = ( cos (c*(2*pi)/360) * (( cos (a*(2*pi)/360) * y - sin
>(a*(2*pi)/360)*z)) + sin (c*(2*pi)/360) * ( cos (b*(2*pi)/360)*(x) +
>sin (b*(2*pi)/360) * ( cos (a*(2*pi)/360) * z + sin
>(a*(2*pi)/360)*y)))
>
>o = ( cos (b*(2*pi)/360) * ( cos (a*(2*pi)/360) * z + sin
>(a*(2*pi)/360)*y) - sin (b*(2*pi)/360)*(x))


A first step towards simplification: Remove the degree-radian conversions

d = a*(2*pi)/360
e = b*(2*pi)/360
f = c*(2*pi)/360

m = ( cos(f) * ( cos(e) * x + sin(e) * ( cos(d) * z + sin (d)*y)) -
sin(f) * (( cos(d) * y - sin(d)*z)))

n = ( cos(f) * (( cos(d) * y - sin(d)) + sin(f) * ( cos(e)*(x) +
sin(e) * ( cos(d) * z + sin(d)))

o = ( cos(e) * ( cos(d) * z + sin(d)*y) - sin(e)*(x))

--
Mark


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: hello all can some one help me simplify a formula
Date: 14 Apr 2001 23:22:16
Message: <3ad913e8@news.povray.org>
For starters, try:

atemp = a*(2*pi)/360
btemp = b*(2*pi)/360
ctemp = c*(2*pi)/360

m = (cos(ctemp) * (cos(btemp) * x + sin(btemp) * (cos(atemp) * z +
  sin(atemp) * y)) - sin(ctemp) * ((cos(atemp) * y - sin(atemp) * z)))

n = (cos(ctemp) * ((cos(atemp) * y - sin(atemp) * z)) + sin(ctemp) *
  (cos(btemp) * x + sin(btemp) * (cos(atemp) * z + sin(atemp) * y)))

o = (cos(btemp) * (cos(atemp) * z + sin(atemp) * y) - sin (btemp) * x)


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: hello all can some one help me simplify a formula
Date: 14 Apr 2001 23:32:54
Message: <3ad91666@news.povray.org>
And then do:

d = a*(2*pi)/360
e = b*(2*pi)/360
f = c*(2*pi)/360

sd = sin(d)
cd = cos(d)
se = sin(e)
ce = cos(e)
sf = sin(f)
cf = cos(f)

m = (cf * ce * x + se * (cd * z + sd * y)) - sf * (cd * y - sd * z)))

n = (cf * ((cd * y - sd) + sf * (ce * x + se * (cd * z + sd))

o = (ce * (cd * z + sd * y) - se * x)



____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: hello all can some one help me simplify a formula
Date: 14 Apr 2001 23:49:12
Message: <3ad91a38$1@news.povray.org>
If you want to go further for some reason, you could also eleminate 
common subexpressions...

d = a*(2*pi)/360
e = b*(2*pi)/360
f = c*(2*pi)/360

sd = sin(d)
cd = cos(d)
se = sin(e)
ce = cos(e)
sf = sin(f)
cf = cos(f)

zy = cd * z + sd * y
yz = cd * y - sd * z

m = cf * (ce * x + se * zy) - sf * yz
n = cf * (yz + sf * (ce * x + se * zy))
o = ce * zy - se * x


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Alan Kong
Subject: Re: hello all can some one help me simplify a formula
Date: 15 Apr 2001 07:32:08
Message: <ri1jdtsq4vd0oj52urr1en3283411lrj0c@4ax.com>
On Sun, 15 Apr 2001 04:01:22 +0100 Adam Gibbons wrote:

>i know that this dose not have much to do with povray, as it is a maths
>question. but i have posed help up on many math message boards and i get on
>reply.

  Set followups-to: povray.off-topic, thanks.

  Please read "Welcome To the POV-Ray News Groups", which is posted in the
p.announce.frequently-asked-questions group. Thanks again for helping to
keep some semblance of organisation to our news groups.

-- 
Alan - ako### [at] povrayorg - a k o n g <at> p o v r a y <dot> o r g
http://www.povray.org - Home of the Persistence of Vision Ray Tracer


Post a reply to this message

From: Warp
Subject: Re: hello all can some one help me simplify a formula
Date: 15 Apr 2001 13:06:15
Message: <3ad9d506@news.povray.org>
Adam Gibbons <Fie### [at] emailcom> wrote:
: please don't post up any bullshit like why do you want to simplify these
: formulas it will not make povray any faster.

  Why do you want to simplify these formulas? It will not make povray
any faster.

  ;)

  (Of course this is not true, but I just had to say it...)

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

From: Anton Sherwood
Subject: Re: hello all can some one help me simplify a formula
Date: 12 May 2001 20:58:27
Message: <3AFDDC69.B46F084A@pobox.com>
Adam Gibbons wrote:
> i know that this dose not have much to do with povray, as it is
> a maths question. but i have posed help up on many math message
> boards and i get on reply.

Like where?

> basically i would like the following formulas simplified.
> that is if they can be simplified.

Ask rather whether they can be further complicated.

>  can some one please simplify the following equations for me.
> 
> m = ( cos (c*(2*pi)/360) * ( cos (b*(2*pi)/360) * x + sin
> (b*(2*pi)/360) * ( cos (a*(2*pi)/360) * z + sin (a*(2*pi)/360)*y)) -
> sin (c*(2*pi)/360) * (( cos (a*(2*pi)/360) * y - sin
> (a*(2*pi)/360)*z)))

etc.

For a start, (2*pi)/360 = pi/180.
And next, *if* you're using povray, consider the degrees() function.

-- 
Anton Sherwood  --  br0### [at] p0b0xcom  --  http://ogre.nu/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.