Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Need to find a side on triangle
Need to find a side on triangle
2002-12-26, 1:33 PM #1
I need to find R on the diagram using cog. But the problem is I dont think cog has sin. I have alpha, and L.

Heres the picture:

[http://24.46.164.108:81/jkteambattle/images/media/needtofindr.gif]

Anyone got any ideas?
Team Battle.
2002-12-26, 1:45 PM #2
Nope. No sin. Hehe, trig is a sin. [http://forums.massassi.net/html/smile.gif]
And when the moment is right, I'm gonna fly a kite.
2002-12-26, 1:47 PM #3
Oi, thats not helpful! I need a solution [http://forums.massassi.net/html/frown.gif]
Team Battle.
2002-12-26, 1:57 PM #4
I spose I could write an array of values and then use that. Still not my favourite solution [http://forums.massassi.net/html/frown.gif]
Team Battle.
2002-12-26, 1:57 PM #5
A solution? Find some other way to do what you need. [http://forums.massassi.net/html/frown.gif] Sorry man, there just isnt any sine functions in cog.
And when the moment is right, I'm gonna fly a kite.
2002-12-27, 4:14 AM #6
Quote:
<font face="Verdana, Arial" size="2">Originally posted by GBK:
Nope. No sin. Hehe, trig is a sin. [http://forums.massassi.net/html/smile.gif] </font>


I knew I had seen that in the Bible somewhere. I just couldn't find the chapter and verse when I went looking for it. [http://forums.massassi.net/html/wink.gif]

------------------
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.
www.swgalaxies.net For all your Star Wars Galaxies needs
The Massassi A SW Galaxies Player Association
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.
www.swgalaxies.net For all your Star Wars Galaxies needs
The Massassi A SW Galaxies Player Association
2002-12-27, 6:16 AM #7
There are algebra approximations of sine
but I dont know if they are good enough for your purposes.
- Wisdom is 99% experience, 1% knowledge. -
2002-12-27, 9:49 AM #8
You really couldnt do algebra in cog either . . thank God.
And when the moment is right, I'm gonna fly a kite.
2002-12-27, 9:57 AM #9
You gotta do that opposite/adjacent etc and crap.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2002-12-27, 10:18 AM #10
Yeah. Trig. Hey, I know! Lets write a cog to do trig with Radians!!! [http://forums.massassi.net/html/rolleyes.gif]
And when the moment is right, I'm gonna fly a kite.
2002-12-27, 12:46 PM #11
I was talking simply about division.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2002-12-28, 3:32 AM #12
Not a solution but for everyones amusement I tried creating my own sin function in cog.

I took the algebraic estimation of sin from here: http://www.caffeinehigh.net/narf/the%20evils%20of%20sin.htm

and the result was:

Code:
# Rough Estimation of Sine Function using algebra
symbols

message     user1

flex        pi             local
flex        x              local
flex        sinofx         local
flex        xdegree        local

end
# =============================
code

user1:
xdegree = GetParam(0);    // Get submited value in degrees
pi = 3.141593;            // Establish pi - will JK allow more acuraccy than this ?
x = xdegree*pi/180;       // Convert degrees to radians
                          // Next line contains rough algebra estimation of Sine
sinofx = 32/(45*(pi*pi*pi*pi*pi)) * ((x*x*x*x*x) - (5*(pi*pi)*(x*x*x)) + (4*(pi*pi*pi*pi)*x));
ReturnEx(sinofx);         // Return answer to  Sin(degrees)
Return;

end


Unfortunately the estimation is way to rough to be usable. I hope you have better luck with your array method.
- Wisdom is 99% experience, 1% knowledge. -
2002-12-28, 6:19 AM #13
Sure, that might work, but we still dont know what Hellcat needed it for in the first place.
And when the moment is right, I'm gonna fly a kite.
2002-12-28, 11:47 AM #14
I need to it take over the world mwhaha.

Actually I need quite close answers, so I am just writing out sin of 1, 2, 3, 4, etc than going from that. If I get lazy I might write very second value.
Team Battle.
2002-12-28, 11:42 PM #15
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Hellcat:
I need to it take over the world mwhaha.

Actually I need quite close answers, so I am just writing out sin of 1, 2, 3, 4, etc than going from that. If I get lazy I might write very second value.
</font>


Get The positions where R crosses the two sides of triangle, and use VectorDist();

How you would get the positions, that's not my problem [http://forums.massassi.net/html/tongue.gif]


------------------
Cave_Demon, an ***hole since '86
Last edited by mb; today at 10:55 AM.
2002-12-29, 12:43 AM #16
Yeah that what I was gonna do. Run a real fast pulse, fire a projectile from the vertexes on line L (use 90 - alpha) and find the closest point to where they crossed using getthingpos(). Using that position I could then use VectorDist();.

I already thought of that accept its not a nice solution, it would be easier to write them out [http://forums.massassi.net/html/tongue.gif]
Team Battle.
2002-12-29, 1:52 AM #17
what you need this for, anyway? maybe i'll find another solution

------------------
Cave_Demon, an ***hole since '86
Last edited by mb; today at 10:55 AM.
2002-12-29, 8:04 AM #18
Yes, do tell.
And when the moment is right, I'm gonna fly a kite.
2002-12-29, 12:25 PM #19
*Sigh*

I need to calculate the angular velocity and the centripedal force on a vehicle with a specific wheelbase.

And as we all know
R = L / sin(alpha)
So we can then calculate
F(c) = (m * v * v) / R

Understand what I'm trying to say?
Team Battle.
2002-12-29, 1:08 PM #20
Pinky: Egad! You astound me, Brain!
- Wisdom is 99% experience, 1% knowledge. -
2002-12-30, 6:21 PM #21
Huh?
Team Battle.
2002-12-30, 6:50 PM #22
If JK used a more modern engine with a real programming language, you might be able to do that, but for JK, I think you might be boned. [http://forums.massassi.net/html/frown.gif]

Infact, on a more modern engine, you could use real physics with it instead of having to fake everything (I hate faking stuff).
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2002-12-30, 7:11 PM #23
I'm not faking anything. Hense the reason why I am using all my sine values. I have written alot of my own physics in jk to handle a drivable vehicle(Currently using corvette specs, 5.7lt etc) All I need now is to finish the centripedal forces to add broadside capabilites. Unfortunatly I havnt found a good solution for the brakes. (I am using IsThingCrouching for acceleration, then applying thrust to the player.)

When its finished I will post a demo level in here for you all to play with.
Team Battle.

↑ Up to the top!