POV-Ray : Newsgroups : povray.general : At wits' end Server Time
18 May 2024 14:07:41 EDT (-0400)
  At wits' end (Message 5 to 14 of 24)  
<<< Previous 4 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Bald Eagle
Subject: Re: At wits' end
Date: 13 Mar 2016 22:30:00
Message: <web.56e6214b509d798c5e7df57c0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Posted.

Maybe that ought to be:

http://news.povray.org/povray.binaries.images/thread/%3Cweb.56e620c88e79eb4c5e7df57c0%40news.povray.org%3E/

:O


Post a reply to this message

From: Anthony D  Baye
Subject: Re: At wits' end
Date: 13 Mar 2016 22:40:00
Message: <web.56e62410509d798cfd6b6fe10@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > Posted.
>
> Maybe that ought to be:
>
>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.56e620c88e79eb4c5e7df57c0%40news.povray.org%3E/
>
> :O

hmmm... your math differs from the site I was using for information.

As for the logo solution, I've done it that way before.  This is something else
I wanted to try.

And it still doesn't explain the strange floating-point error I get out of the
vec2rot macro.  I've narrowed it down to that particular spot: The vector I get
out of that macro does not conform to the angle I give it.

Regards,
A.D.B.


Post a reply to this message

From: Anthony D  Baye
Subject: Re: At wits' end
Date: 14 Mar 2016 00:10:00
Message: <web.56e6395f509d798cfd6b6fe10@news.povray.org>
"Anthony D. Baye" <Sha### [at] spamnomorehotmailcom> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > "Bald Eagle" <cre### [at] netscapenet> wrote:
> > > Posted.
> >
> > Maybe that ought to be:
> >
> >
http://news.povray.org/povray.binaries.images/thread/%3Cweb.56e620c88e79eb4c5e7df57c0%40news.povray.org%3E/
> >
> > :O
>
> hmmm... your math differs from the site I was using for information.
>
> As for the logo solution, I've done it that way before.  This is something else
> I wanted to try.
>
> And it still doesn't explain the strange floating-point error I get out of the
> vec2rot macro.  I've narrowed it down to that particular spot: The vector I get
> out of that macro does not conform to the angle I give it.
>
> Regards,
> A.D.B.

Also, that right angle you have there doesn't make a 45-degree angle with L/2

the rise is sqrt(3)/2 or sin(60), the run is 0.5 (half the side length) +
sin(30) ==> 1 so atan(sqrt(3)/2)) ~= 40.8934 degrees which makes the upper
(downward) angle ~= 49.1066 degrees.

Regards,
A.D.B.


Post a reply to this message

From: Anthony D  Baye
Subject: Re: At wits' end
Date: 14 Mar 2016 01:00:00
Message: <web.56e64487509d798cfd6b6fe10@news.povray.org>
"Anthony D. Baye" <Sha### [at] spamnomorehotmailcom> wrote:
> "Anthony D. Baye" <Sha### [at] spamnomorehotmailcom> wrote:
> > "Bald Eagle" <cre### [at] netscapenet> wrote:
> > > "Bald Eagle" <cre### [at] netscapenet> wrote:
> > > > Posted.
> > >
> > > Maybe that ought to be:
> > >
> > >
http://news.povray.org/povray.binaries.images/thread/%3Cweb.56e620c88e79eb4c5e7df57c0%40news.povray.org%3E/
> > >
> > > :O
> >
> > hmmm... your math differs from the site I was using for information.
> >
> > As for the logo solution, I've done it that way before.  This is something else
> > I wanted to try.
> >
> > And it still doesn't explain the strange floating-point error I get out of the
> > vec2rot macro.  I've narrowed it down to that particular spot: The vector I get
> > out of that macro does not conform to the angle I give it.
> >
> > Regards,
> > A.D.B.
>
> Also, that right angle you have there doesn't make a 45-degree angle with L/2
>
> the rise is sqrt(3)/2 or sin(60), the run is 0.5 (half the side length) +
> sin(30) ==> 1 so atan(sqrt(3)/2)) ~= 40.8934 degrees which makes the upper
> (downward) angle ~= 49.1066 degrees.
>
> Regards,
> A.D.B.

which makes that scalene section 19.1066:120:40.8934

regards,
A.D.B.


Post a reply to this message

From: scott
Subject: Re: At wits' end
Date: 14 Mar 2016 04:13:23
Message: <56e672a3$1@news.povray.org>
> So if anyone can tell me what I'm doing wrong below, I'll be grateful.

Two mistakes...

> #macro vec2rot(V, A)
>      #local _X_ = -V.u*cos(A)*sin(A) - V.v*cos(A)*sin(A);
>      #local _Y_ = V.u*sin(A)*cos(A) + V.v*sin(A)*cos(A);
>      #local RESULT = <_X_,_Y_>;
>      RESULT
> #end

This is wrong, should be:

#macro vec2rot(V, A)
     #local _X_ = V.u*cos(A) - V.v*sin(A);
     #local _Y_ = V.u*sin(A) + V.v*cos(A);
     #local RESULT = <_X_,_Y_>;
     RESULT
#end

You seem to have made it too complicated, it's just a 2D rotation:

https://en.wikipedia.org/wiki/Rotation_matrix#In_two_dimensions

> #local np1 = (len/sqrt(7))*vec2rot( vT,asin(sqrt(3)/(2*sqrt(7))));
> #local np2 = (len/sqrt(7))*vec2rot( vT,-asin(sqrt(3)/(2*sqrt(7))));

These are wrong, should be:

#local np1 = p0 + len/sqrt(7)*vec2rot( vT,asin(sqrt(3)/(2*sqrt(7))));
#local np2 = p1 - len/sqrt(7)*vec2rot( vT,asin(sqrt(3)/(2*sqrt(7))));

np1 is at p0 plus the distance len/sqrt(7) times your new direction.

np2 is at p1 *minus* the distance len/sqrt(7) times the new direction.


Post a reply to this message

From: scott
Subject: Re: At wits' end
Date: 14 Mar 2016 06:48:46
Message: <56e6970e$1@news.povray.org>
>> Maybe that ought to be:
>>
>>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.56e620c88e79eb4c5e7df57c0%40news.povray.org%3E/
>>
>> :O
>
> hmmm... your math differs from the site I was using for information.

His diagram lines are OK, but some of the angles are wrong. Actually so 
long as you know the angles of a hexagon (120 degrees), just use 
Pythagoras on the lower left triangle (the one with hypotenuse L/2).

(L/2)^2 = (S/2 + S*sin(30))^2 + (Scos(30))^2
(L/2)^2 = (S/2 + S/2      )^2 + 3/4*S^2
(L/2)^2 = 7/4 * S^2
  L^2    = 7 * S^2
  L      = sqrt(7) * S


Post a reply to this message

From: Bald Eagle
Subject: Re: At wits' end
Date: 14 Mar 2016 10:30:00
Message: <web.56e6c9d0509d798c5e7df57c0@news.povray.org>
scott <sco### [at] scottcom> wrote:

> His diagram lines are OK, but some of the angles are wrong. Actually so
> long as you know the angles of a hexagon (120 degrees), just use
> Pythagoras on the lower left triangle (the one with hypotenuse L/2).

Yes, apologies for that.   It was a quick sketch I was drawing out at the very
end of the day.  It should have clicked when I was aware of the difference in
length between the horizontal and vertical catheti - that the angles would be
what I originally hastily labeled them as, but that just didn't happen.

I'm learning more and more from my own experience that it's important to just
put it down for a while and come back to it with fresh eyes and a fresh mind.
It can then take mere seconds to see what I've been looking straight past for
hours.

Good catches, Scott.   I had only just begun to familiarize myself with the
geometry of the algorithm, but you just homed right in on it all.  That also
shows me where the sqrt(7) term comes from, which would have bothered me until I
figured it out.   :)


Post a reply to this message

From: Bald Eagle
Subject: Re: At wits' end
Date: 14 Mar 2016 11:55:02
Message: <web.56e6ddd9509d798c5e7df57c0@news.povray.org>
ADB wrote:
> the rise is sqrt(3)/2 or sin(60), the run is 0.5 (half the side length) +
> sin(30) ==> 1 so atan(sqrt(3)/2)) ~= 40.8934 degrees which makes the upper
> (downward) angle ~= 49.1066 degrees.

and
scott <sco### [at] scottcom> wrote:

> (L/2)^2 = (S/2 + S*sin(30))^2 + (Scos(30))^2
> (L/2)^2 = (S/2 + S/2      )^2 + 3/4*S^2
> (L/2)^2 = 7/4 * S^2
>   L^2    = 7 * S^2
>   L      = sqrt(7) * S


You two seem to have a peculiar (to me) way of going about your trig.
Either they do it a different and, admittedly, interesting way on "The Other
Side of The Pond", than we do here in 'Murica, or -
"We" do it weird, or -
I just never really learned it very well.

I recall going through something like this puzzling out Friederich Lohmueller's
pulley/belt calculations with Jerome.
You pick what, to me, is the least obvious approach.  :D

I'd like to hear and see more about all of this side/2+side*sin(30) business.
I did it what seems to me a more direct way, but got the same answer. {whew!}
:)

See my updated diagram.   Hopefully it's correct - I haven't yet finished coffee
#1.
I'm going to ponder how this gets converted into code, since there's an ever
increasing number of line segments to be drawn at every next level.


Post a reply to this message

From: scott
Subject: Re: At wits' end
Date: 14 Mar 2016 12:18:40
Message: <56e6e460$1@news.povray.org>
>> (L/2)^2 = (S/2 + S*sin(30))^2 + (Scos(30))^2
>> (L/2)^2 = (S/2 + S/2      )^2 + 3/4*S^2
>> (L/2)^2 = 7/4 * S^2
>>    L^2    = 7 * S^2
>>    L      = sqrt(7) * S
>
>
> You two seem to have a peculiar (to me) way of going about your trig.
> Either they do it a different and, admittedly, interesting way on "The Other
> Side of The Pond", than we do here in 'Murica, or -
> "We" do it weird, or -
> I just never really learned it very well.
>
> I recall going through something like this puzzling out Friederich Lohmueller's
> pulley/belt calculations with Jerome.
> You pick what, to me, is the least obvious approach.  :D
>
> I'd like to hear and see more about all of this side/2+side*sin(30) business.
> I did it what seems to me a more direct way, but got the same answer. {whew!}
> :)

The problem is, assuming the horizontal distance to be S requires you to 
either know that (I didn't) or figure it out from S/2+Ssin(30) or some 
other geometric method.

I think I did it because I have a habit to start from the minimum 
possible number of assumptions, in this case a hexagon has side length S 
and angle 120 degrees. That's enough information to solve it. I've found 
in past situations that faulty assumptions are often what cause errors, 
so I try not to make them if they are not needed.

> See my updated diagram.   Hopefully it's correct - I haven't yet finished coffee
> #1.
> I'm going to ponder how this gets converted into code, since there's an ever
> increasing number of line segments to be drawn at every next level.

Just get the macro to call itself again (with some countdown to prevent 
going forever):

#macro gosper_axiom(p0, p1,N)
  #if(N>=0)
     cylinder { p0, p1 0.0078125 }
     #local V = p1 - p0;
     #local vT = vnormalize(V);
     #local len = vlength(V);
     #local np1=p0+len/sqrt(7)*vec2rot( vT,asin(sqrt(3)/(2*sqrt(7))));
     #local np2=p1-len/sqrt(7)*vec2rot( vT,asin(sqrt(3)/(2*sqrt(7))));

     gosper_axiom(p0,np1,N-1)
     gosper_axiom(np1,np2,N-1)
     gosper_axiom(np2,p1,N-1)

  #end
#end

Call with eg:

gosper_axiom(<-3,0>,<3,0>,5)


Post a reply to this message

From: Anthony D  Baye
Subject: Re: At wits' end
Date: 14 Mar 2016 14:20:01
Message: <web.56e700a2509d798ca36927440@news.povray.org>
scott <sco### [at] scottcom> wrote:
> >> (L/2)^2 = (S/2 + S*sin(30))^2 + (Scos(30))^2
> >> (L/2)^2 = (S/2 + S/2      )^2 + 3/4*S^2
> >> (L/2)^2 = 7/4 * S^2
> >>    L^2    = 7 * S^2
> >>    L      = sqrt(7) * S
> >
> >
> > You two seem to have a peculiar (to me) way of going about your trig.
> > Either they do it a different and, admittedly, interesting way on "The Other
> > Side of The Pond", than we do here in 'Murica, or -
> > "We" do it weird, or -
> > I just never really learned it very well.
> >
> > I recall going through something like this puzzling out Friederich Lohmueller's
> > pulley/belt calculations with Jerome.
> > You pick what, to me, is the least obvious approach.  :D
> >
> > I'd like to hear and see more about all of this side/2+side*sin(30) business.
> > I did it what seems to me a more direct way, but got the same answer. {whew!}
> > :)
>
> The problem is, assuming the horizontal distance to be S requires you to
> either know that (I didn't) or figure it out from S/2+Ssin(30) or some
> other geometric method.
>
> I think I did it because I have a habit to start from the minimum
> possible number of assumptions, in this case a hexagon has side length S
> and angle 120 degrees. That's enough information to solve it. I've found
> in past situations that faulty assumptions are often what cause errors,
> so I try not to make them if they are not needed.
>
> > See my updated diagram.   Hopefully it's correct - I haven't yet finished coffee
> > #1.
> > I'm going to ponder how this gets converted into code, since there's an ever
> > increasing number of line segments to be drawn at every next level.
>
> Just get the macro to call itself again (with some countdown to prevent
> going forever):
>
> #macro gosper_axiom(p0, p1,N)
>   #if(N>=0)
>      cylinder { p0, p1 0.0078125 }
>      #local V = p1 - p0;
>      #local vT = vnormalize(V);
>      #local len = vlength(V);
>      #local np1=p0+len/sqrt(7)*vec2rot( vT,asin(sqrt(3)/(2*sqrt(7))));
>      #local np2=p1-len/sqrt(7)*vec2rot( vT,asin(sqrt(3)/(2*sqrt(7))));
>
>      gosper_axiom(p0,np1,N-1)
>      gosper_axiom(np1,np2,N-1)
>      gosper_axiom(np2,p1,N-1)
>
>   #end
> #end
>
> Call with eg:
>
> gosper_axiom(<-3,0>,<3,0>,5)
I've tried that. I get "too many nested symbol tables"

More when I'm not posting from my iPod

AB


Post a reply to this message

<<< Previous 4 Messages Goto Latest 10 Messages Next 10 Messages >>>

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