POV-Ray : Newsgroups : povray.general : Stupid math error Server Time
6 Aug 2024 12:23:49 EDT (-0400)
  Stupid math error (Message 1 to 5 of 5)  
From: Xplo Eristotle
Subject: Stupid math error
Date: 1 Apr 2002 22:51:49
Message: <3CA92B31.5E72FE6A@unforgettable.com>
Okay, this is driving me nuts. I have a bunch of 4 x .5 x 1 boxes which
are stacked corner to corner in a stair pattern. Given their layout, I
thought/assumed that they make a 30 degree angle with the ground (a
plane), but when I added another box on the side and rotated it up 30
degrees, it didn't line up with the blocks!

I'm stumped. Barring some kind of bug, I can't imagine why I'm having
this problem; the math isn't particularly complicated here. Can anyone
help me with this? Code follows:

#declare stair_row = union
	{
	#declare stair_row_members = 1;
	#declare stair_row_count = 0;
	#while (stair_row_count < stair_row_members)
		box { <0, 0, 0> <4, .5, 1> }
		#declare stair_row_count = stair_row_count + 1;
	#end
	}
	
#declare stair_block = union
	{
	#declare stair_rows = 10;
	#declare stair_row_count = 0;
	#while (stair_row_count < stair_rows)
		object { stair_row translate <0, stair_row_count/2, stair_row_count> }
		#declare stair_row_count = stair_row_count + 1;
	#end
	}
	
#declare stair_rail = union
	{
	box { <0, -in, 0> <in*1, 0, 15> rotate <-30, 0, 0> }
	}

(An image demonstrating the problem has been posted in p.b.i.)

I'm using MacMegaPOV 0.7 (I don't care for the present interface of the
official beta) on Mac OS 8.6, if anyone cares.

-Xplo


Post a reply to this message

From: David F 
Subject: Re: Stupid math error
Date: 2 Apr 2002 04:28:36
Message: <pan.2002.04.02.03.39.07.320562.23227@ednet.rvc.cc.il.us>
On Mon, 01 Apr 2002 21:53:25 -0600, Xplo Eristotle wrote:

> Okay, this is driving me nuts. I have a bunch of 4 x .5 x 1 boxes which
> are stacked corner to corner in a stair pattern. Given their layout, I
> thought/assumed that they make a 30 degree angle with the ground (a
> plane), but when I added another box on the side and rotated it up 30
> degrees, it didn't line up with the blocks!
> 
> I'm stumped. Barring some kind of bug, I can't imagine why I'm having
> this problem; the math isn't particularly complicated here. Can anyone
> help me with this? Code follows:
> 

<snip>

> -Xplo

ok, one of you math geniuses can correct me if I'm wrong here, but I
think your problem is that the boxes do not form a 30 degree angle with
the ground...

taking a corss-section from the side view, you essentially are stacking
.5 x 1, and let's place the first one so the bottom left corner is at the
origin, like so: 
 
  |
  |
  |   __
  |  |  |
  |__|__|
  |  |
  |  |
--------------------

ok, the upper right corner of the second box is at (1,2), which gives you
a triange with sides of length 1, 2, sqrt(5).  Manipulating
the pythagorean theorem, you get something similar to the following:
1=sqrt((1/sqrt(5))^2+(2/sqrt(5))^2).  So on the unit circle, you have an
x value of 1/sqrt(5), and a y value of 2/sqrt(5), and acos(1/sqrt(5)) is
approximately equal to 63.435.  I haven't tried this in your code, so I'm
not sure if this will work, but I'm pretty sure I didn't make any
mistakes.  Though, you never know at 3:30 in the morning.  Hope this
helps!

-- 

David
smuchrusher <at> ameritech <dot> net
ICQ#: 118347772

3:10am up 4 days, 11:48, 4 users, load average: 3.80, 3.33, 3.11


Post a reply to this message

From: David F 
Subject: Re: Stupid math error
Date: 2 Apr 2002 04:44:58
Message: <pan.2002.04.02.03.55.33.418120.23227@ednet.rvc.cc.il.us>
On Tue, 02 Apr 2002 03:39:11 -0600, David F. wrote:

> On Mon, 01 Apr 2002 21:53:25 -0600, Xplo Eristotle wrote:
> 
>> Okay, this is driving me nuts. I have a bunch of 4 x .5 x 1 boxes which
>> are stacked corner to corner in a stair pattern. Given their layout, I
>> thought/assumed that they make a 30 degree angle with the ground (a
>> plane), but when I added another box on the side and rotated it up 30
>> degrees, it didn't line up with the blocks!
>> 
>> I'm stumped. Barring some kind of bug, I can't imagine why I'm having
>> this problem; the math isn't particularly complicated here. Can anyone
>> help me with this? Code follows:
>> 
>> 
> <snip>
> 
>> -Xplo
> 
> ok, one of you math geniuses can correct me if I'm wrong here, but I
> think your problem is that the boxes do not form a 30 degree angle with
> the ground...
> 
> taking a corss-section from the side view, you essentially are stacking
> .5 x 1, and let's place the first one so the bottom left corner is at
> the origin, like so:
>  
>   |
>   |
>   |   __
>   |  |  |
>   |__|__|
>   |  |
>   |  |
> --------------------
> 
> ok, the upper right corner of the second box is at (1,2), which gives
> you a triange with sides of length 1, 2, sqrt(5).  Manipulating the
> pythagorean theorem, you get something similar to the following:
> 1=sqrt((1/sqrt(5))^2+(2/sqrt(5))^2).  So on the unit circle, you have an
> x value of 1/sqrt(5), and a y value of 2/sqrt(5), and acos(1/sqrt(5)) is
> approximately equal to 63.435.  I haven't tried this in your code, so
> I'm not sure if this will work, but I'm pretty sure I didn't make any
> mistakes.  Though, you never know at 3:30 in the morning.  Hope this
> helps!
> 


oops... jsut saw everyone's response in p.b.i, though I am still curious
if this is logically correct....

-- 

David
smuchrusher <at> ameritech <dot> net
ICQ#: 118347772

3:10am up 4 days, 11:48, 4 users, load average: 3.80, 3.33, 3.11


Post a reply to this message

From: Slime
Subject: Re: Stupid math error
Date: 2 Apr 2002 13:48:10
Message: <3ca9fcea$1@news.povray.org>
Without taking a long time to look at your math, I'd say that yes you are
correct, since you came up with the number

63.435

and I came up with the number

26.565
in my own post, and those numbers added together make 90.

- Slime
[ http://www.slimeland.com/ ]
[ http://www.slimeland.com/images/ ]


Post a reply to this message

From: Xplo Eristotle
Subject: Re: Stupid math error
Date: 2 Apr 2002 14:51:02
Message: <3CAA0C02.ADFC7CC2@unforgettable.com>
Slime wrote:
> 
> Without taking a long time to look at your math, I'd say that yes you are
> correct, since you came up with the number
> 
> 63.435
> 
> and I came up with the number
> 
> 26.565
> in my own post, and those numbers added together make 90.

Yeah. Thanks for the help, guys.

-Xplo


Post a reply to this message

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