![]() |
Doctine Question Relative Bearings
I was looking at some doctines for evasion of weapons, contacts etc
I found this in Actuv's rather complicated SubAvoidSub and when I looked at it, it didn't make sense to me. func Tactic1 { IF RelativeBearing OwnCrs TgtBrg < 0 THEN { OrdCrs = ( TgtBrg + 150 + rnd 30 mod 360 ) } ELSE { OrdCrs = ( TgtBrg + 210 - rnd 30 mod 360 ) } ENDIF BEARSOUTH } I checked the doctrine format document and RelativeBearing RelativeBearing <value1> <value2> Returns the relative bearing from <value1> to <value2> But don't relative bearings work through 360 degrees, unlike say TgTAOB which is plus / minus degrees for stb and port? So, ignoring BEARSOUTH, doesn't this function always give an ordered course of tgt brg + 210 (plus rnd) every time... The condition will always return a positive value? Sorry but boring, but I've seen this often in the doctrines. I think I have something wrong. This one works well for detecting incoming torps: ( abs RelativeBearing TgtCrs ( TgtBrg + 180 mod 360 ) < 35 ) This requires the absolute value because you modulo? And could end up with a -ve number easily...? Duh, ok i think I found my mistake OwnCrs can be greater than TgtBrg, obvious really... |
All times are GMT -5. The time now is 12:49 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.