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 → GBK, SaberMaster, or any other advanced cogger
GBK, SaberMaster, or any other advanced cogger
2002-07-15, 12:36 PM #1
In cog, you have the operators +, -, *, /, %, =, ==, !, &, &&, |, || <, <=, =>, and >. I was wondering is there a verb or operator to do sine (sin), cosine (cos) and, tangent (tan) along with their inverse (ex. sin^[-1] )? Also, is there any verb or operator for Square Roots?

------------------
The Sniper Missions. Current project, The Sniper Missions

[This message has been edited by Descent_pilot (edited July 15, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-15, 3:14 PM #2
I havent the slightest idea. This is more SMs line of expertise....
And when the moment is right, I'm gonna fly a kite.
2002-07-15, 3:17 PM #3
There is no sin, cos, or tan, but you could get the engine to do it for you. All you would have to do would be to have a ghost object, create another ghost object one unit in front of it and attach it to the first chost object. Then rotate the first ghost object the angle you want to find the sine, cosing, or tangent of. The final x position minus the original x position will be the cosine, yf-yo will be the sine, and (yf-yo)/(xf-xo) will be the tangent. The other option is to do an array of floats. Just write a program to create the text file for you.
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2002-07-15, 3:19 PM #4
If you give me a bit of time, I believe I could find a way to trick the engine into calculating square roots for you too.
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2002-07-15, 3:21 PM #5
These are the easy ways, by the way, the way I would do it would be to have an inline Taylor series expansion for whatever particular function I wanted to perform. Well, the first way is easier if you don't know mathematics, but if you DO know mathematics, a Taylor series would be much easier.
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2002-07-15, 4:13 PM #6
Before anybody askes, I was thinking of using this for one of the puzzles in one of The Sniper Missions most likly The X Project's level The Star's Beauty , and I was just abit curious as well. [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-15, 4:27 PM #7
If you could tell me precisely what functions you need, I'd be glad to send you the taylor series for it. Just tell me the functions and the precision you need them to be. If you could tell me what you're going to be using them for in that level, that'd be cool too.
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2002-07-15, 5:03 PM #8
I was going to do it for a hyperspace route puzzle. The answer would be 60 degrees left (think 150 degrees in trig), followed by 48 degrees right. Making something like this.
Code:
         48______
          /
         /
________/60
If you can give some numbers for the distance, that'd be great, along with the forumlas to get it. [http://forums.massassi.net/html/wink.gif] (I've only passed algebra I, but I do know/don't quite remember trigonametric ratios [http://forums.massassi.net/html/redface.gif] )

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-16, 10:35 AM #9
I don't quite understand what you're asking for. What distances do you want?
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2002-07-16, 11:02 AM #10
The distances for the lines. (the underscores and the backslashes in the code block)

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-16, 7:17 PM #11
You can make them as long or as short as you want unless you have specific horizontal or vertical distances. Can you describe more clearly the situation this is for?
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2002-07-17, 7:04 AM #12
Does anyone else understand what he's asking for? Maybe I'm just missing something, but you haven't given me enough information for me to tell you the lengths of the lines.
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2002-07-17, 2:02 PM #13
I was just looking for some numbers that might work. I also want to know how you got to those because I forgot most of the Trig ratios and how to solve them. I just want some figures and I'll scale them to the sizes I want. understand now?

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-17, 2:23 PM #14
What numbers? You can use any distances you want for those lines. You haven't given me any information that would allow me to infer anything about the relative sizes. You can change them to have any relation at all to each other and still retain the angles. Do you want a horizontal and vertical distance for the last two lines? That's the only thing I can come up with that might possibly be what you're asking for.

Could you just tell me what you're tryig to do? That might be easier than trying to interpret what you're asking for.
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2002-07-18, 2:36 PM #15
Quote:
<font face="Verdana, Arial" size="2">I was wondering is there a verb or operator to do sine (sin), cosine (cos) and, tangent...</font>


No, Cog doesn't provide any functions for sine or cosine. The mathmatical formula for sin/cos must be rather complex. What's this 'Taylor series expansion', Basher?

Still, getting sin/cos values ingame isn't impossible if you're desperate. Take sine for example: you could use the heap verbs to create a 0-360 array and then have 360 heapsets to give the array correct sine values. Then when you needed a sine value, you could use HeapGet(angle) to return the sine.

That would be difficult to do and there's probably a better way of doing it.

Quote:
<font face="Verdana, Arial" size="2">Also, is there any verb or operator for Square Roots?</font>


No, but you could use a while loop if you needed to.

Well, good luck with your project. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-18, 2:54 PM #16
I've been doing my project for the past, *looks at calender that isn't there* oh lets say four months or so. I'll finish, slowy but surly. [http://forums.massassi.net/html/biggrin.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-19, 6:48 AM #17
It's basic calculus. It essentially is the process by which you approximate a function through a polynomial. There are other series you can use as well, like the power series, but not all of them work for all functions. Taylor/McLauran series reproduce the values of the function and it's successive derivatives. Each successive polynomial term you add increases the accuracy of the approximation. If you want more detail just let me know, but I don't think anyone here really cares, so I'm not posting more unless someone actually wants to know.

By the way, through a series of emails I finally determined what he wanted. He just wants the distance from the start point to the end point. I'm going to write up a general solution to a 3 line/2 angle distance problem when I get home from work today.
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2002-07-19, 7:07 AM #18
I only passed Algebra 1, we did learn a sine, cosine, and tangent. But calculus?

------------------
The Sniper Missions. Current project, The Sniper Missions

[This message has been edited by SaberMaster (edited July 19, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-19, 7:48 AM #19
What's so amazing about calculus? How old are you?
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2002-07-19, 8:15 AM #20
13 and 1/2, and still learning.
[http://forums.massassi.net/html/biggrin.gif] [http://forums.massassi.net/html/biggrin.gif] [http://forums.massassi.net/html/biggrin.gif] [http://forums.massassi.net/html/smile.gif] [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

(since 8 is the max per post, a [http://forums.massassi.net/html/biggrin.gif] is and a [http://forums.massassi.net/html/smile.gif] is 1, and [http://forums.massassi.net/html/wink.gif] is 1/2, yep using faces to display my age)

[This message has been edited by Descent_pilot (edited July 19, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-19, 8:49 AM #21
I suppose that explains it. I was done with the first two years of calculus at the end of my sophomore year or high school.
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2002-07-19, 9:53 AM #22
I know geometry, but noooooo, I have to take it agian. I could pass it. But Dublin Unified School District (DSUD) is so screwed up. They hold back people like me for money. The system is run by beuracrats and politians!

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-19, 12:28 PM #23
Ah, that explains it, Basher. Thanks.


Beuracrats and Politians, eh? Geometry perhaps, but not spelling. [http://forums.massassi.net/html/tongue.gif] [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.

[This message has been edited by SaberMaster (edited July 19, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-19, 12:48 PM #24
Ahh, so that's what my coding isn't always right. [http://forums.massassi.net/html/tongue.gif] See SetWallCell();

------------------
The Sniper Missions. Current project, The Sniper Missions

[This message has been edited by Descent_pilot (edited July 19, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack

↑ Up to the top!