POV-Ray : Newsgroups : povray.binaries.images : Rotating Squares problem Server Time
12 Aug 2024 11:23:40 EDT (-0400)
  Rotating Squares problem (Message 11 to 16 of 16)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Remco de Korte
Subject: Re: Rotating Squares problem
Date: 8 Oct 2003 17:49:48
Message: <3F8485E7.921829B0@onwijs.com>
Patrick Dugan wrote:
> 
> I would like any help someone can give regarding a math problem in Povray.
> 

I didn't quite follow the source posted here and saw that your problem
is already solved but since I've been struggling with the exact same
things some time ago and only barely worked it out, by trial and error,
it struck me now that there might be a fairly simple solutions: drop the
rotation part!
Start with the bottom square (or box), move from the corner along the
side for a fixed percentage of the side length, do that for every side
(in the same direction). The four resulting points will form a new
square. 
Put this in a recursive macro and there you go.

Toch? Jan?

Remco


Post a reply to this message

From: Samuel Benge
Subject: Re: Rotating Squares problem
Date: 9 Oct 2003 12:12:12
Message: <3F8588D8.6080308@hotmail.com>
I'm unschooled in the field of traditional trigonomentry usage.... where 
did you get the number 4.725?

None wrote:

> I think Reduce should simply be set to something like:
> 
> #declare Reduce = X * tan(radians(4.725));
> 


-- 
Samuel Benge

stb### [at] hotmailcom


Post a reply to this message

From: Patrick Dugan
Subject: Re: Rotating Squares problem
Date: 9 Oct 2003 21:15:47
Message: <3f860843$1@news.povray.org>
The number wasn't significant.  I simply testing various Z axis rotation
sizes and by trial and error (mostly error) ended up on that number.

"Samuel Benge" <sbe### [at] hotmailcom> wrote in message
news:3F8### [at] hotmailcom...
> I'm unschooled in the field of traditional trigonomentry usage.... where
> did you get the number 4.725?
>
> None wrote:
>
> > I think Reduce should simply be set to something like:
> >
> > #declare Reduce = X * tan(radians(4.725));
> >
>
>
> -- 
> Samuel Benge
>
> stb### [at] hotmailcom
>


Post a reply to this message

From: None
Subject: Re: Rotating Squares problem
Date: 10 Oct 2003 08:44:44
Message: <Xns941058FAA5D0BNone@204.213.191.226>
Samuel Benge <sbe### [at] hotmailcom> wrote in news:3F8588D8.6080308
@hotmail.com:

> I'm unschooled in the field of traditional trigonomentry usage.... where 
> did you get the number 4.725?

That was simply the angle Patrick was rotating by, I pluged in the angle he 
was using in his code into a standard trig. equation:

tan(angle) = Opposite/Adjacent.

Trigonometry is the measurement of triangles.  A square can be broken down 
into eight right angle triangles.  In the eighth of a square, the Opposite 
(O) and Adjacent (A) are the same.  So if you change the angle while 
keeping O or A the same, it will tell you how much the new A or O should 
be.

Search the net for "trigonometry sin cos tan" for explanations of 
trigonometry.


Post a reply to this message

From: Tim Cook
Subject: Re: Rotating Squares problem
Date: 10 Oct 2003 10:34:37
Message: <3f86c37d$1@news.povray.org>
None wrote:
> Trigonometry is the measurement of triangles.  A square can be broken down 
> into eight right angle triangles.  In the eighth of a square, the Opposite 
> (O) and Adjacent (A) are the same.  So if you change the angle while 
> keeping O or A the same, it will tell you how much the new A or O should 
> be.

For efficiency, it's easier to just break a square into two triangles.
^_^  Also in a square you can't change the angles, or it ceases to be
a square.  They will always be 45 and 90 degrees.


Post a reply to this message

From: None
Subject: Re: Rotating Squares problem
Date: 10 Oct 2003 11:12:37
Message: <Xns9410720C8A5DBNone@204.213.191.226>
Tim Cook <z99### [at] bellsouthnet> wrote in
news:3f86c37d$1@news.povray.org: 

> For efficiency, it's easier to just break a square into two triangles.
> ^_^  Also in a square you can't change the angles, or it ceases to be
> a square.  They will always be 45 and 90 degrees.

Efficiency?  In this case the square is centered at the origin, that's 
where it's rotated from, so that's where the angle is, so we are dealing 
with the eigtht, but we only care about _one_ triangle.  If you want to 
just use two triangles to solve this case, you're going to have to do 
more math, which would be innefficient.

Of course a square's triangle angle can't change, that is exactly what we 
are taking advantage of in this case.  I said: the opposite and adjacent 
sides are the same, so the angle is obviously fixed.  In this case, if 
the angle changes, we are determining by how much we need to adjust the 
sides to keep the angle constant.

It sounds like you took my message completely out of context.  I was 
reffering to the problem at hand, the original question.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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