Difference between revisions of "Template:Direction"

From GTAMods Wiki
Jump to navigation Jump to search
m
 
Line 1: Line 1:
<includeonly><table {{prettytable}}>
+
<includeonly><table class="wikitable">
 
<tr>
 
<tr>
 
<th>Compass</th>
 
<th>Compass</th>
{{#if:{{{deg|}}}|<th> Degrees </th>}}
+
{{#switch:{{lc:{{{1|}}}}}
{{#if:{{{rad|}}}|<th> Radians </th>}}</tr>
+
|deg=<th> Degrees </th>
 +
|rad=<th> Radians </th>
 +
|<th> Degrees </th><th> Radians </th>}}</tr>
 
<tr>
 
<tr>
 
<td>North</td>
 
<td>North</td>
{{#if:{{{deg|}}}|<td> 0&deg; </td>}}
+
{{#switch:{{lc:{{{1|}}}}}
{{#if:{{{rad|}}}|<td> 0 </td>}}</tr>
+
|deg=<td> 0&deg; </td>
 +
|rad=<td> 0 </td>
 +
|<td> 0&deg; </td><td> 0 </td>}}</tr>
 
<tr>
 
<tr>
 
<td>West</td>
 
<td>West</td>
{{#if:{{{deg|}}}|<td> 90&deg; </td>}}
+
{{#switch:{{lc:{{{1|}}}}}
{{#if:{{{rad|}}}|<td> &pi;/2 &#8776; {{#expr: pi / 2 round 2 }} </td>}}</tr>
+
|deg=<td> 90&deg; </td>
 +
|rad=<td> &pi;/2 &#8776; {{#expr: pi / 2 round 2 }} </td>
 +
|<td> 90&deg; </td><td> &pi;/2 &#8776; {{#expr: pi / 2 round 2 }} </td>}}</tr>
 
<tr>
 
<tr>
 
<td>South</td>
 
<td>South</td>
{{#if:{{{deg|}}}|<td> 180&deg; </td>}}
+
{{#switch:{{lc:{{{1|}}}}}
{{#if:{{{rad|}}}|<td> &pi; &#8776; {{#expr: pi round 2 }} </td>}}</tr>
+
|deg=<td> 180&deg; </td>
<tr><td>East</td>
+
|rad=<td> &pi; &#8776; {{#expr: pi round 2 }} </td>
{{#if:{{{deg|}}}|<td> 270&deg; </td>}}
+
|<td> 180&deg; </td><td> &pi; &#8776; {{#expr: pi round 2 }} </td>}}</tr>
{{#if:{{{rad|}}}|<td> 3&pi;/2 &#8776; {{#expr: 3 * pi / 2 round 2 }} </td>}}</tr>
+
<tr>
 +
<td>East</td>
 +
{{#switch:{{lc:{{{1|}}}}}
 +
|deg=<td> 270&deg; </td>
 +
|rad=<td> 3&pi;/2 &#8776; {{#expr: 3 * pi / 2 round 2 }} </td>
 +
|<td> 270&deg; </td><td> 3&pi;/2 &#8776; {{#expr: 3 * pi / 2 round 2 }} </td>}}</tr>
 
</table></includeonly><noinclude>
 
</table></includeonly><noinclude>
 
Degrees only:
 
Degrees only:
<pre>{{direction|deg=1}}</pre>
+
<pre>{{direction|deg}}</pre>
{{direction|deg=1}}
+
{{direction|deg}}
 
Radians only:
 
Radians only:
<pre>{{direction|rad=1}}</pre>
+
<pre>{{direction|rad}}</pre>
{{direction|rad=1}}
+
{{direction|rad}}
 
Both:
 
Both:
<pre>{{direction|deg=1|rad=1}}</pre>
+
<pre>{{direction}}</pre>
{{direction|deg=1|rad=1}}
+
{{direction}}
 
</noinclude>
 
</noinclude>

Latest revision as of 20:27, 10 November 2016

Degrees only:

{{direction|deg}}
Compass Degrees
North
West 90°
South 180°
East 270°

Radians only:

{{direction|rad}}
Compass Radians
North 0
West π/2 ≈ 1.57
South π ≈ 3.14
East 3π/2 ≈ 4.71

Both:

{{direction}}
Compass Degrees Radians
North 0
West 90° π/2 ≈ 1.57
South 180° π ≈ 3.14
East 270° 3π/2 ≈ 4.71