that is math i never learned because i never had math beyond 6th grade and as such i have no idea what you are talking about.(i never learned advanced math like that). please calculate the coordinates for meg.
I see.
Let's have this table.
Let % be your Town Hall.
Code:
+----------x----------
| +------------------+
| | 1 2 3 4 5 6 7 8 9|
| |1 |
| |2 |
| |3 |
y |4 |
| |5 % |
| |6 |
| |7 |
| |8 |
| |9 |
| +------------------+
Now let's place a Farm named F.
Code:
+----------x----------
| +------------------+
| | 1 2 3 4 5 6 7 8 9|
| |1 |
| |2 |
| |3 |
y |4 |
| |5 % |
| |6 |
| |7 F |
| |8 |
| |9 |
| +------------------+
As you can see, Farm F is located just south west of Town Hall %.
The coordinates of % is (6, 5).
The coordinates of F is (5, 7).
Basic will tell you that coordinates are in the form of (x, y).
Now to calculate the distance, you need this formula.
Let:
A = x coordinate of %
B = y coordinate of %
C = x coordinate of F
D = y coordinate of F
Code:
distance = sqrt( (C - A)^2 + (D - B)^2 )
sqrt is square root, ^2 is an exponent.
So, you need to actually want to know what C and D, right?
----
Okay, what if I want to know the coordinates of the building I wanted to place?
Let's take this sample again.
Code:
+----------x----------
| +------------------+
| | 1 2 3 4 5 6 7 8 9|
| |1 |
| |2 |
| |3 |
y |4 |
| |5 % |
| |6 |
| |7 F |
| |8 |
| |9 |
| +------------------+
I wanted to play a Workshop W.
Let's review our given.
point of % = (6, 5)
distance of % and W = 3 units (assuming you want this distance)
the angle where the distance goes to = 135 degrees
In Trigonometry, You have SOH CAH TOA, a formula again in actuality.
Code:
sine THETA = OPPOSITE / HYPOTENUSE
cosine THETA = ADJACENT / HYPOTENUSE
tangent THETA = OPPOSITE / HYPOTENUSE
I've drawn something for you. About the trigo thing I'm saying.
So from here, you need to compute for the ADJACENT and OPPOSITE.
Deriving from the
SOH CAH TOA formulae...
Code:
OPPOSITE = (sine THETA) * HYPOTENUSE
ADJACENT = (cosine THETA) * HYPOTENUSE
But wait, the angle is in 135 degrees. We want to get the actual angle as displayed in the drawing. We know that the angle from 0 (East) to 180 (West) is a full 180 degrees. So we will derive our angle...
Code:
180 - 135 = THETA
THETA = 45 degrees
So, in summary, the coordinates of
W is
(A [+-] ADJACENT, B [+-] OPPOSITE).
[+-] is either addition or subtraction, depending on what side of the Cartesian plane the point is located. Currently, the center of this is the
TOWN HALL %.
Correct me if I am wrong somewhere guys. Also elaborate more on confusing parts that I just posted. For the Topic Starter, I'm sure this is a lot to take in, feel free to ask questions.