OK after many a cup of coffee, mad hystercial manical laughter, and occasionally a good idea... I ahve come up with the latest and greatest system of formulas. This method takes the simplification of the entire problem to a whole new level of laziness. Mathmatical and equational laziness, you will have to actually do SOME thing to get your answers to pop out. This approach fixes the shocking variety of errors I made in previous attempts (I have no idea what I was smoking then) and distills the essence of it down to its component brillance. And as and added bonus I even throw in a bit at the end to tell you how much time should be taken for the torpedo to reach the target because, well, I'm just that kind of guy/geek.
1. Finding True North Relative Bearing to Target
Need:
Bt = Bearing to Target Relative to Sub Heading
Hs(n) = Heading of Sub relative to True North
Will Get:
Bt(n) = Bearing to Target Relative to True North from Sub
Code: Select all
Bt(n) = Hs(n) + Bt
if (Bt(n) >= 360)
{ Bt(n) = Bt(n) - 360 }
2. Finding Reverse True North Bearing
Need:
Bt(n) = Bearing to Target Relative to True North from Sub ** from Section 1 above
Will Get:
Bs(n) = Bearing to Sub relative to True North from Target
Code: Select all
Bs(n) = Bt(n) + 180
if ( Bt(n) >= 360)
{ Bs(n) = Bs(n) - 360 }
3. Find Bearing to Sub Relative to Target Heading
Need:
Bs(n) = Bearing to Sub relative to True North from Target ** from Section 2
Ht(n) = Heading of Target realtive to North
Will Get:
Bs = Bearing to Sub Relative to Target's Heading
Code: Select all
Bs = Bs(n) - Ht(n)
if ( Bs > 180)
{ Bs = Ht(n) + (360 - Bs(n) ) }
if ( Bs < -180 )
{ Bs = Bs(n) + (360 - Ht(n) ) }
if ( Bs < 0) ? ** See Notes **
{ Bs = Bs * -1 }
4. Solve for Gyro Angle
Need:
Vp = Speed of Torpedo (knots)
Vt = Speed of Target (knots)
Bs = Bearing to Sub Relative to Target's Heading ** from Section 3
Will Get:
A = Gyro Angle to set Torpedos
5. Finding Time to Impact ** See Notes **
Need:
R = Range to Target (meters)
Bs = Bearing to Sub Relative to Target's Heading ** from Section 3
A = Gyro Angle ** from Section 4
Vp = Speed of Torpedo (knots)
Will Get:
T = Time to Target (seconds)
Code: Select all
if ( A >= (180- A - Bs) ?AND ( A >= Bs)
{ x = R * Tan B }
else
{ x = R / ( cos A) }
T = x / ( .7851 * Vp)
NOTES:
Section 1: Basically we are just looking for the bearing to the target but, we need to make it relative to True North instead of to the bearing of sub. When you look at a ship its bearing is according to which direction you are pointing, we need to account for that and find out what that bearing is according to North.
Section 2: Really easy bit, we basically just need to know what the opposite dirction would be. Duh... its 180 degrees. We just have to remember not to go over 360 degrees.
Section 3: Now we already have that North relative bearing back to the sub, we now need to make it back to being relative but, to the target's heading this time. We figure out what that angle should be relative to the target's heading then spit out the result. It is entirely possible to get a negative answer here, thats not wrong at all. Thats merely reflecting whether the sub is port of starboard of the target's track, you could use that yourself if you wanted to compute other things but, I am ignoring it for simplicty. That is why I have that "* -1" part there.
Section 4: Taken from the Silent Hunter manuel how to find the gyro angle.
Section 5: This part is entirely extra It just figures out how long the torpedos should be running until they hit the target. I could explain the math behind it but... well I don't want to take pages to do it. Its basically using the SOHCAHTOA rule from high scholl trig, angles A + B + C and the range R to find the remianing side depending on which angle is the hypotonuese or the largest angle. Finding how many meters per second per knot goes and that computed distance in meters.
Now I await for you to point out whats wrong with this. Go on! I know you want to!