![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
![]() |
#1 |
Seasoned Skipper
![]() Join Date: Mar 2005
Location: UK
Posts: 683
Downloads: 104
Uploads: 1
|
![]()
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... Last edited by Jace11; 01-17-19 at 03:06 PM. |
![]() |
![]() |
Tags |
bea |
|
|