Ask a Question related to Macromedia Director Lingo, Design and Development.
-
James #1
infuriating Cos problems
Hi, I realise this has been asked alot in the past, and I've been searching
around trying to figure out what is going wrong, but I'm beginning to lose
my hair, so I hope someone can just prod me with a big stick and tell me
what on earth I'm doing wrong here.
Ok i dug out the old trig book, to try and work out an angle from the length
of the adjacent and hypotenuse lines from a right angle triangle.
which reads:
cosine x = hypotenuse / adjacent
so in their example
cosine x = 9 / 11 = 0.81818
no probs there.
I then want to turn that in to degrees sooooo after searching around the net
and google came up with:
put cos(0.818181818) * (180 / pi())
--39.164573749
unfortunatly the book says I should be getting 35.1 so as you can see I'm 4
degrees out! Have I got completely the wrong end of the stick here (should I
start arguing with the book?).
I really wish I had managed to stay awake in math at school, hope someone
out there can help me :-)
thanks
James
James Guest
-
Installation problems are infuriating!
I am so frustrated and mad that I am not able to install flash player and i'm sure a lot of you guys are as well! I don't know why anybody from... -
Problems with %
Anyone ever had a problem with passing the % sign in their code, and having the server go crazy and start producing too many threads? -
problems with preLoadNetThing and fileName (was problems with preLoadNetThing and importFileInto)
You don't want to leave the QT member in your cast when you publish your movie - it's not really there, it's linked. When you run the movie it will... -
xkb problems (still)
Solaris 8 - latest patches. xkb is mostly better than it's been, but I still can't figure out how to get repeat to work, including by changing... -
MGaston #2
Re: infuriating Cos problems
You're looking at the wrong thing. The cosine of the angle is
adjacent/hypotenuse. So the cosine of the angle is 0.81818. The angle
itself isn't 0.81818. To find the angle you need to use acos, not cos. I
just did it on my calculator [acos(0.81818)] and got 35.0968 degrees.
HTH,
Matt
James <james@twisted-pixel.com> wrote in message
news:br5fqu$acl$1@forums.macromedia.com...searching> Hi, I realise this has been asked alot in the past, and I've beenlength> around trying to figure out what is going wrong, but I'm beginning to lose
> my hair, so I hope someone can just prod me with a big stick and tell me
> what on earth I'm doing wrong here.
>
> Ok i dug out the old trig book, to try and work out an angle from thenet> of the adjacent and hypotenuse lines from a right angle triangle.
>
> which reads:
>
> cosine x = hypotenuse / adjacent
>
> so in their example
>
> cosine x = 9 / 11 = 0.81818
>
> no probs there.
>
> I then want to turn that in to degrees sooooo after searching around the4> and google came up with:
>
> put cos(0.818181818) * (180 / pi())
>
> --39.164573749
>
> unfortunatly the book says I should be getting 35.1 so as you can see I'mI> degrees out! Have I got completely the wrong end of the stick here (should> start arguing with the book?).
>
> I really wish I had managed to stay awake in math at school, hope someone
> out there can help me :-)
>
> thanks
> James
>
>
MGaston Guest
-
James #3
Re: infuriating Cos problems
ok cheers but that then gives me the prblem that the arc cos fuction doesnt
exist within director, and i've just messed around with an example script
that is supposed to emulate it, but i'm not having ne luck so far. I'll keep
searching, but if you have a lingo example of this working i would be
eteinally grateful :-)
james
"MGaston" <mattgaston@interfold.com> wrote in message
news:br5na9$jq4$1@forums.macromedia.com...lose> You're looking at the wrong thing. The cosine of the angle is
> adjacent/hypotenuse. So the cosine of the angle is 0.81818. The angle
> itself isn't 0.81818. To find the angle you need to use acos, not cos. I
> just did it on my calculator [acos(0.81818)] and got 35.0968 degrees.
>
> HTH,
> Matt
>
> James <james@twisted-pixel.com> wrote in message
> news:br5fqu$acl$1@forums.macromedia.com...> searching> > Hi, I realise this has been asked alot in the past, and I've been> > around trying to figure out what is going wrong, but I'm beginning toI'm> length> > my hair, so I hope someone can just prod me with a big stick and tell me
> > what on earth I'm doing wrong here.
> >
> > Ok i dug out the old trig book, to try and work out an angle from the> net> > of the adjacent and hypotenuse lines from a right angle triangle.
> >
> > which reads:
> >
> > cosine x = hypotenuse / adjacent
> >
> > so in their example
> >
> > cosine x = 9 / 11 = 0.81818
> >
> > no probs there.
> >
> > I then want to turn that in to degrees sooooo after searching around the> > and google came up with:
> >
> > put cos(0.818181818) * (180 / pi())
> >
> > --39.164573749
> >
> > unfortunatly the book says I should be getting 35.1 so as you can see(should> 4> > degrees out! Have I got completely the wrong end of the stick heresomeone> I> > start arguing with the book?).
> >
> > I really wish I had managed to stay awake in math at school, hope>> > out there can help me :-)
> >
> > thanks
> > James
> >
> >
>
James Guest
-
James #4
Re: infuriating Cos problems
and ya never know it might help my typos too ;-)
"James" <james@twisted-pixel.com> wrote in message
news:br5oco$l4i$1@forums.macromedia.com...doesnt> ok cheers but that then gives me the prblem that the arc cos fuctionkeep> exist within director, and i've just messed around with an example script
> that is supposed to emulate it, but i'm not having ne luck so far. I'llI> searching, but if you have a lingo example of this working i would be
> eteinally grateful :-)
>
> james
>
>
> "MGaston" <mattgaston@interfold.com> wrote in message
> news:br5na9$jq4$1@forums.macromedia.com...> > You're looking at the wrong thing. The cosine of the angle is
> > adjacent/hypotenuse. So the cosine of the angle is 0.81818. The angle
> > itself isn't 0.81818. To find the angle you need to use acos, not cos.me> lose> > just did it on my calculator [acos(0.81818)] and got 35.0968 degrees.
> >
> > HTH,
> > Matt
> >
> > James <james@twisted-pixel.com> wrote in message
> > news:br5fqu$acl$1@forums.macromedia.com...> > searching> > > Hi, I realise this has been asked alot in the past, and I've been> > > around trying to figure out what is going wrong, but I'm beginning to> > > my hair, so I hope someone can just prod me with a big stick and tellthe> > length> > > what on earth I'm doing wrong here.
> > >
> > > Ok i dug out the old trig book, to try and work out an angle from the> > > of the adjacent and hypotenuse lines from a right angle triangle.
> > >
> > > which reads:
> > >
> > > cosine x = hypotenuse / adjacent
> > >
> > > so in their example
> > >
> > > cosine x = 9 / 11 = 0.81818
> > >
> > > no probs there.
> > >
> > > I then want to turn that in to degrees sooooo after searching around> I'm> > net> > > and google came up with:
> > >
> > > put cos(0.818181818) * (180 / pi())
> > >
> > > --39.164573749
> > >
> > > unfortunatly the book says I should be getting 35.1 so as you can see> (should> > 4> > > degrees out! Have I got completely the wrong end of the stick here> someone> > I> > > start arguing with the book?).
> > >
> > > I really wish I had managed to stay awake in math at school, hope>> >> > > out there can help me :-)
> > >
> > > thanks
> > > James
> > >
> > >
> >
>
James Guest
-
James #5
Re: infuriating Cos problems
by the way please ignore me typing in the adj and hyp the wrong way around,
it was a typo as opposed to what I was actually doing *ehm* sorry about that
I am using adjacent/hypotenuse and getting 0.81818 I just can't resolve it
from there.
"James" <james@twisted-pixel.com> wrote in message
news:br5ogs$l7g$1@forums.macromedia.com...script> and ya never know it might help my typos too ;-)
>
> "James" <james@twisted-pixel.com> wrote in message
> news:br5oco$l4i$1@forums.macromedia.com...> doesnt> > ok cheers but that then gives me the prblem that the arc cos fuction> > exist within director, and i've just messed around with an exampleangle> keep> > that is supposed to emulate it, but i'm not having ne luck so far. I'll> > searching, but if you have a lingo example of this working i would be
> > eteinally grateful :-)
> >
> > james
> >
> >
> > "MGaston" <mattgaston@interfold.com> wrote in message
> > news:br5na9$jq4$1@forums.macromedia.com...> > > You're looking at the wrong thing. The cosine of the angle is
> > > adjacent/hypotenuse. So the cosine of the angle is 0.81818. Thecos.> > > itself isn't 0.81818. To find the angle you need to use acos, notto> I> > > just did it on my calculator [acos(0.81818)] and got 35.0968 degrees.
> > >
> > > HTH,
> > > Matt
> > >
> > > James <james@twisted-pixel.com> wrote in message
> > > news:br5fqu$acl$1@forums.macromedia.com...
> > > > Hi, I realise this has been asked alot in the past, and I've been
> > > searching
> > > > around trying to figure out what is going wrong, but I'm beginningtell> > lose> > > > my hair, so I hope someone can just prod me with a big stick andthe> me> > > > what on earth I'm doing wrong here.
> > > >
> > > > Ok i dug out the old trig book, to try and work out an angle fromsee> the> > > length
> > > > of the adjacent and hypotenuse lines from a right angle triangle.
> > > >
> > > > which reads:
> > > >
> > > > cosine x = hypotenuse / adjacent
> > > >
> > > > so in their example
> > > >
> > > > cosine x = 9 / 11 = 0.81818
> > > >
> > > > no probs there.
> > > >
> > > > I then want to turn that in to degrees sooooo after searching around> > > net
> > > > and google came up with:
> > > >
> > > > put cos(0.818181818) * (180 / pi())
> > > >
> > > > --39.164573749
> > > >
> > > > unfortunatly the book says I should be getting 35.1 so as you can>> > I'm> > (should> > > 4
> > > > degrees out! Have I got completely the wrong end of the stick here> > someone> > > I
> > > > start arguing with the book?).
> > > >
> > > > I really wish I had managed to stay awake in math at school, hope> >> > > > out there can help me :-)
> > > >
> > > > thanks
> > > > James
> > > >
> > > >
> > >
> > >
> >
>
James Guest
-
Andrew Morton #6
Re: infuriating Cos problems
In a movie script:-
on acos(x)
if abs(x)>1 then
alert("acos() does not support complex numbers.")
return void
end if
return atan(sqrt(1-x*x), x)*180/pi
end acos
If you're going to use acos() a lot and you know you are not going to pass it a
number outside [-1, 1] then take out the "if abs(x)>1...end if" part and set a
global to the value of 180/pi and use that instead of calculating 180/pi every
time.
Andrew
Andrew Morton Guest
-
James #7
Re: infuriating Cos problems
thanks Andrew it works beautifully :-D, have a pint on me (_)>
James
"Andrew Morton" <akm@in-press.co.uk.invalid> wrote in message
news:br6oke$2o2$2@forums.macromedia.com...it a> In a movie script:-
>
> on acos(x)
> if abs(x)>1 then
> alert("acos() does not support complex numbers.")
> return void
> end if
> return atan(sqrt(1-x*x), x)*180/pi
> end acos
>
> If you're going to use acos() a lot and you know you are not going to passset a> number outside [-1, 1] then take out the "if abs(x)>1...end if" part andevery> global to the value of 180/pi and use that instead of calculating 180/pi> time.
>
> Andrew
>
James Guest



Reply With Quote

