Welcome to ATS' own wiki.

Read and remember the rules and conventions, they can be found at Help

Dakan's Notes on Pitch and Yaw

From ATS Wiki

Contents

Introduction

A common thing to do during space fighting is to want to show a certain arc to a target. Now, you probably know about the three course commands: 'yaw', 'pitch' and 'roll'. There's also the useful 'inter' and 'evade' commands to aim directly at or away from a target. So, how do you use these to various shields?

For fore or aft, it's pretty obvious: use 'inter' to show front, 'evade' to show aft. But how about the others? If you try and use 'yaw' alone to face port or starboard, there's the possibility that you'll run into a confounding problem called gimbal lock.

I am going to try and make a (hopefully convincing) case that you should only use 'inter', 'pitch' and 'roll' to show side shields.


What to do

Basically, all you have to do is do 'inter #', then 'pitch 90'. At any point you can use 'roll 90', 'roll '180' or 'roll -90' to set the desired side shield (port, starboard, dorsal or ventral). During the fight, to face the side you just do 'inter #' then 'pitch 90', and leave the roll alone until you want to switch which side shield is facing.

This is a simple way to do it, and behaves nicely all the time. If you don't care much about the geometry behind this, you can stop here and take my word on it (or try it yourself in the sims). If you are curious about the math behind it, read on.

Euler Angles and ATS

ATS space uses something called an Euler Angle system for representing courses. The three angles that are used (which are shown in 'stat' or 'sr' in nav mode) are yaw, pitch and roll. The difficulty comes from the fact they are always applied in this order: yaw, pitch, then roll. This can lead to some unexpected behaviour in certain cases.

Here's the simple case: there's a target bearing 0 0.

--[Sensor Report]--------------------------------------------------------------
### Type Res Bearing Range   S Heading Speed  S Name               Class Flags
--- ---- --- ------- ------- - ------- ------ - ------------------------ ------
  2 Base 100   0 0   43.9688 F   0 0     None A The Starbase             Abm   
--- ---- --- ------- ------- - ------- ------ - ------------------------ ------
  1 Plan 100   0 0   43.9688 F   0 0     None A Ground Zero                    
-------------------------------------------------------------------------------
          Course: 0.000 0.000                    Speed: -40.000% Impulse    
        Location: Open Space                  Velocity: 11.9917 SU/sec      
-------------------------------------------------------------------------------

Now, let's see what happens when I do yaw 90.

--[Sensor Report]--------------------------------------------------------------
### Type Res Bearing Range   S Heading Speed  S Name               Class Flags
--- ---- --- ------- ------- - ------- ------ - ------------------------ ------
  2 Base 100   0 0   43.9688 P   0 0     None A The Starbase             Abm   
--- ---- --- ------- ------- - ------- ------ - ------------------------ ------
  1 Plan 100   0 0   43.9688 P   0 0     None A Ground Zero                    
-------------------------------------------------------------------------------
          Course: 90.000 0.000                   Speed: Stationary          
        Location: Open Space                  Velocity: Stationary          
-------------------------------------------------------------------------------

Facing port, just like you'd expect. Now here comes the interesting part. Let's try this again with a target at angle 0 80. Here, I've intercepted the starbase and (as expected) I'm facing fore.

--[Sensor Report]--------------------------------------------------------------
### Type Res Bearing Range   S Heading Speed  S Name               Class Flags
--- ---- --- ------- ------- - ------- ------ - ------------------------ ------
  2 Base 100 360 80  70.5754 F   0 0     None V The Starbase             Abm   
--- ---- --- ------- ------- - ------- ------ - ------------------------ ------
  1 Plan 100 360 80  70.5754 F   0 0     None V Ground Zero                    
-------------------------------------------------------------------------------
          Course: 359.990 79.650                 Speed: Stationary          
        Location: Open Space                  Velocity: Stationary          
-------------------------------------------------------------------------------

So, let's try that yaw 90 again.

--[Sensor Report]--------------------------------------------------------------
### Type Res Bearing Range   S Heading Speed  S Name               Class Flags
--- ---- --- ------- ------- - ------- ------ - ------------------------ ------
  2 Base 100 360 80  70.5754 F   0 0     None V The Starbase             Abm   
--- ---- --- ------- ------- - ------- ------ - ------------------------ ------
  1 Plan 100 360 80  70.5754 F   0 0     None V Ground Zero                    
-------------------------------------------------------------------------------
          Course: 89.990 79.650                  Speed: Stationary          
        Location: Open Space                  Velocity: Stationary          
-------------------------------------------------------------------------------

We're still facing fore. Maybe we should try yawing farther? Here goes yaw 180.

--[Sensor Report]--------------------------------------------------------------
### Type Res Bearing Range   S Heading Speed  S Name               Class Flags
--- ---- --- ------- ------- - ------- ------ - ------------------------ ------
  2 Base 100 360 80  70.5754 F   0 0     None V The Starbase             Abm   
--- ---- --- ------- ------- - ------- ------ - ------------------------ ------
  1 Plan 100 360 80  70.5754 F   0 0     None V Ground Zero                    
-------------------------------------------------------------------------------
          Course: 179.990 79.650                 Speed: Stationary          
        Location: Open Space                  Velocity: Stationary          
-------------------------------------------------------------------------------

Now we've yawed 180 and we're still facing fore. What's going on? We've hit the condition I mentioned before, gimbal lock. At this high a pitch, changing yaw will alter your actual course very little.

As mentioned above, the angles were applied in the order Yaw > Pitch > Roll. A result of this is that certain angles of pitch can make your yaw setting essentially meaningless.


Graphical View

To see this graphically, look at this picture.


Hope this was helpful!