SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 12-17-10, 03:38 PM   #11
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Antar View Post
t_torp - time when torpedo is hit to target
v_ship - target speed
r_ship - last calculated distance to target
AoB - AoB
t_angle - track angle

'calculate all angles in triangle (uboat-target-hit.point)
aux.angle = 180-AoB- (90-t_angle)

'law of sine to calculate intervals (ways) of ship/torpedo
s_ship = r_ship * sin(aux.angle) / sin(90-t_angle)
s_torp = r_ship * sin(AoB) / sin(90-t_angle)

'to hit torp.time = ship.time
t_torp = s_ship / v_ship

When you change the torpedo speed the track angle is changed, so v_speed value is included at t_angle.
I see one problem with this - what happens when target speed is 0 (division by 0 not allowed)

Plus I think this is overcomplicated - we should be able to simply take distance to target / torp speed to find time to impact

EDIT:

ok, after thinking it over we do need to calculate like you posted Antar in order to take into account target's speed.

I don't see how you are factoring in torp speed into this calculation?

EDIT2:

Seems to be a problem with this calculation. Time value is going positive and negative like a sin function...

track angle and angle on bow are values of -180 to 180 (not 0 to 360). That might be why.

EDIT3:

math functions don't like it when you pass them angles instead of radians...so now time is steady but the time increases as the target gets closer.....

Are we not doing anything with s_torp?? The division by 0 is still a problem also

Last edited by TheDarkWraith; 12-17-10 at 04:18 PM.
TheDarkWraith is offline   Reply With Quote
 

Tags
dbrn, favorite, new ui


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 1995- 2026 Subsim®
"Subsim" is a registered trademark, all rights reserved.