Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.04 KB | None | 0 0
  1. private static Vector3 WindDirTendancy(double latitude, CelestialBody body)
  2. {
  3. Vessel vessel = FlightGlobals.ActiveVessel;
  4. CelestialBody orbitingBody = FlightGlobals.currentMainBody;
  5. String orbitingBodyName = orbitingBody.bodyName;
  6. Vector3 Up = vessel.upAxis; //get the up relative to the surface
  7. Up.Normalize(); //normalize that shit
  8. Vector3 East = Vector3.Cross(vessel.mainBody.angularVelocity, Up); //Get the reverse East axis
  9. East.Normalize(); //Normalize that shit
  10. Vector3 North = Vector3.Cross(East, vessel.upAxis); //Get the reverse north axis
  11. North.Normalize();//Guess what? Normalize that shit
  12. Vector3d coriolisAcc = FlightGlobals.getCoriolisAcc(TradeWindTendancy, body);
  13.  
  14. switch(latitude)
  15. {
  16. case 1:
  17. break;
  18. default:
  19. break;
  20. }
  21.  
  22.  
  23.  
  24. if(orbitingBodyName == "Kerbin")
  25. {
  26. //Trade wind stuff below
  27. if (Latitude >= -5 && Latitude <= 5) //Easterly trade wind at the Inter-Tropical Convergence zone
  28. {
  29. FlightGlobals.getCoriolisAcc(TradeWindTendancy, body);
  30. //Debug.Log("Wind is Easterly!");
  31. //This area is nominally of lower pressure
  32. TradeWindTendancy = -East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  33. windDirectionNumb = 2;
  34. }
  35.  
  36. if (Latitude > 5 && Latitude <= 15) //Hadley Cell, North Easterly trade wind
  37. {
  38. TradeWindTendancy = (North + -East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  39. windDirectionNumb = 5;
  40. }
  41.  
  42. if (Latitude > 15 && Latitude <= 20) //Hadley Cell, Northerly trade wind.
  43. {
  44. TradeWindTendancy = North * (windSpeed * (float)CurrentAtmoPressure);// * RecipDeltaAtmoPressure);
  45. windDirectionNumb = 1;
  46. }
  47.  
  48. if (Latitude > 20 && Latitude <= 27) //Hadley Cell - Sub-Tropical Ridge, North Westerly trade wind
  49. {
  50. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  51. windDirectionNumb = 8;
  52. }
  53.  
  54. if (Latitude > 27 && Latitude <= 33) //Sub-tropical Ridge, Westerlies
  55. {
  56. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  57. windDirectionNumb = 4;
  58. }
  59.  
  60. if (Latitude > 33 && Latitude <= 40) //Sub-Tropical Ridge - Ferrel Cell, Mid-Latitude. Westerlies
  61. {
  62. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  63. windDirectionNumb = 4;
  64. }
  65.  
  66. if (Latitude > 40 && Latitude <= 80) //Ferrel Cell - Polar Cell/Vortex, High Latitude. High Pressure, North Westerlies
  67. {
  68. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  69. windDirectionNumb = 8;
  70. }
  71.  
  72. if (Latitude > 80 && Latitude <= 90) //Extreme high polar region, High Pressure, Northerlies
  73. {
  74. TradeWindTendancy = North * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  75. windDirectionNumb = 1;
  76. }
  77.  
  78.  
  79. //Southern hemisphere
  80. if (Latitude < -5 && Latitude >= -15) //ITCZ - Hadley Cell, South Easterlies
  81. {
  82. TradeWindTendancy = (-North + -East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  83. windDirectionNumb = 6;
  84. }
  85.  
  86. if (Latitude < -15 && Latitude >= -20) //Hadley Cell, Southerlies
  87. {
  88. TradeWindTendancy = -North * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  89. windDirectionNumb = 3;
  90. }
  91.  
  92. if (Latitude < -20 && Latitude >= -27) //Hadley Cell - Sub-Tropical Ridge, North Westerlies
  93. {
  94. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  95. windDirectionNumb = 7;
  96. }
  97.  
  98. if (Latitude < -27 && Latitude >= -33) //Sub-Tropical Ridge, Westerlies
  99. {
  100. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  101. windDirectionNumb = 4;
  102. }
  103.  
  104. if (Latitude < -33 && Latitude >= -40)//Sub-Tropical Ridge - Ferrel Cell, Westerlies
  105. {
  106. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); //* RecipDeltaAtmoPressure);
  107. windDirectionNumb = 4;
  108. }
  109.  
  110. if (Latitude < -40 && Latitude >= -80) //Ferrel Cell - Polar Cell/Vortex, High Latitude. High Pressure, South Westerlies
  111. {
  112. TradeWindTendancy = (-North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  113. windDirectionNumb = 7;
  114. }
  115.  
  116. if (Latitude < -80 && Latitude >= -90) //Polar Cell, High Latitude, High Pressure, Southerlies
  117. {
  118. TradeWindTendancy = -North * (windSpeed * (float)CurrentAtmoPressure); //* RecipDeltaAtmoPressure);
  119. windDirectionNumb = 3;
  120. }
  121.  
  122. }
  123.  
  124. else if (orbitingBodyName == "Duna")
  125. {
  126. //Trade wind stuff below
  127. if (Latitude >= -5 && Latitude <= 5) //Easterly trade wind at the Inter-Tropical Convergence zone
  128. {
  129. //Debug.Log("Wind is Easterly!");
  130. //This area is nominally of lower pressure
  131. TradeWindTendancy = -East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  132. windDirectionNumb = 2;
  133. }
  134.  
  135. if (Latitude > 5 && Latitude <= 15) //Hadley Cell, North Easterly trade wind
  136. {
  137. TradeWindTendancy = (North + -East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  138. windDirectionNumb = 5;
  139. }
  140.  
  141. if (Latitude > 15 && Latitude <= 20) //Hadley Cell, Northerly trade wind.
  142. {
  143. TradeWindTendancy = North * (windSpeed * (float)CurrentAtmoPressure);// * RecipDeltaAtmoPressure);
  144. windDirectionNumb = 1;
  145. }
  146.  
  147. if (Latitude > 20 && Latitude <= 27) //Hadley Cell - Sub-Tropical Ridge, North Westerly trade wind
  148. {
  149. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  150. windDirectionNumb = 8;
  151. }
  152.  
  153. if (Latitude > 27 && Latitude <= 33) //Sub-tropical Ridge, Westerlies
  154. {
  155. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  156. windDirectionNumb = 4;
  157. }
  158.  
  159. if (Latitude > 33 && Latitude <= 40) //Sub-Tropical Ridge - Ferrel Cell, Mid-Latitude. Westerlies
  160. {
  161. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  162. windDirectionNumb = 4;
  163. }
  164.  
  165. if (Latitude > 40 && Latitude <= 80) //Ferrel Cell - Polar Cell/Vortex, High Latitude. High Pressure, North Westerlies
  166. {
  167. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  168. windDirectionNumb = 8;
  169. }
  170.  
  171. if (Latitude > 80 && Latitude <= 90) //Extreme high polar region, High Pressure, Northerlies
  172. {
  173. TradeWindTendancy = North * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  174. windDirectionNumb = 1;
  175. }
  176.  
  177.  
  178. //Southern hemisphere
  179. if (Latitude < -5 && Latitude >= -15) //ITCZ - Hadley Cell, South Easterlies
  180. {
  181. TradeWindTendancy = (-North + -East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  182. windDirectionNumb = 6;
  183. }
  184.  
  185. if (Latitude < -15 && Latitude >= -20) //Hadley Cell, Southerlies
  186. {
  187. TradeWindTendancy = -North * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  188. windDirectionNumb = 3;
  189. }
  190.  
  191. if (Latitude < -20 && Latitude >= -27) //Hadley Cell - Sub-Tropical Ridge, North Westerlies
  192. {
  193. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  194. windDirectionNumb = 7;
  195. }
  196.  
  197. if (Latitude < -27 && Latitude >= -33) //Sub-Tropical Ridge, Westerlies
  198. {
  199. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  200. windDirectionNumb = 4;
  201. }
  202.  
  203. if (Latitude < -33 && Latitude >= -40)//Sub-Tropical Ridge - Ferrel Cell, Westerlies
  204. {
  205. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); //* RecipDeltaAtmoPressure);
  206. windDirectionNumb = 4;
  207. }
  208.  
  209. if (Latitude < -40 && Latitude >= -80) //Ferrel Cell - Polar Cell/Vortex, High Latitude. High Pressure, South Westerlies
  210. {
  211. TradeWindTendancy = (-North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  212. windDirectionNumb = 7;
  213. }
  214.  
  215. if (Latitude < -80 && Latitude >= -90) //Polar Cell, High Latitude, High Pressure, Southerlies
  216. {
  217. TradeWindTendancy = -North * (windSpeed * (float)CurrentAtmoPressure); //* RecipDeltaAtmoPressure);
  218. windDirectionNumb = 3;
  219. }
  220. }
  221.  
  222. else if (orbitingBodyName == "Eve")
  223. {
  224. //Trade wind stuff below
  225. if (Latitude >= -5 && Latitude <= 5) //Easterly trade wind at the Inter-Tropical Convergence zone
  226. {
  227. //Debug.Log("Wind is Easterly!");
  228. //This area is nominally of lower pressure
  229. TradeWindTendancy = -East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  230. windDirectionNumb = 2;
  231. }
  232.  
  233. if (Latitude > 5 && Latitude <= 15) //Hadley Cell, North Easterly trade wind
  234. {
  235. TradeWindTendancy = (North + -East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  236. windDirectionNumb = 5;
  237. }
  238.  
  239. if (Latitude > 15 && Latitude <= 20) //Hadley Cell, Northerly trade wind.
  240. {
  241. TradeWindTendancy = North * (windSpeed * (float)CurrentAtmoPressure);// * RecipDeltaAtmoPressure);
  242. windDirectionNumb = 1;
  243. }
  244.  
  245. if (Latitude > 20 && Latitude <= 27) //Hadley Cell - Sub-Tropical Ridge, North Westerly trade wind
  246. {
  247. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  248. windDirectionNumb = 8;
  249. }
  250.  
  251. if (Latitude > 27 && Latitude <= 33) //Sub-tropical Ridge, Westerlies
  252. {
  253. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  254. windDirectionNumb = 4;
  255. }
  256.  
  257. if (Latitude > 33 && Latitude <= 40) //Sub-Tropical Ridge - Ferrel Cell, Mid-Latitude. Westerlies
  258. {
  259. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  260. windDirectionNumb = 4;
  261. }
  262.  
  263. if (Latitude > 40 && Latitude <= 80) //Ferrel Cell - Polar Cell/Vortex, High Latitude. High Pressure, North Westerlies
  264. {
  265. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  266. windDirectionNumb = 8;
  267. }
  268.  
  269. if (Latitude > 80 && Latitude <= 90) //Extreme high polar region, High Pressure, Northerlies
  270. {
  271. TradeWindTendancy = North * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  272. windDirectionNumb = 1;
  273. }
  274.  
  275.  
  276. //Southern hemisphere
  277. if (Latitude < -5 && Latitude >= -15) //ITCZ - Hadley Cell, South Easterlies
  278. {
  279. TradeWindTendancy = (-North + -East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  280. windDirectionNumb = 6;
  281. }
  282.  
  283. if (Latitude < -15 && Latitude >= -20) //Hadley Cell, Southerlies
  284. {
  285. TradeWindTendancy = -North * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  286. windDirectionNumb = 3;
  287. }
  288.  
  289. if (Latitude < -20 && Latitude >= -27) //Hadley Cell - Sub-Tropical Ridge, North Westerlies
  290. {
  291. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  292. windDirectionNumb = 7;
  293. }
  294.  
  295. if (Latitude < -27 && Latitude >= -33) //Sub-Tropical Ridge, Westerlies
  296. {
  297. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  298. windDirectionNumb = 4;
  299. }
  300.  
  301. if (Latitude < -33 && Latitude >= -40)//Sub-Tropical Ridge - Ferrel Cell, Westerlies
  302. {
  303. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); //* RecipDeltaAtmoPressure);
  304. windDirectionNumb = 4;
  305. }
  306.  
  307. if (Latitude < -40 && Latitude >= -80) //Ferrel Cell - Polar Cell/Vortex, High Latitude. High Pressure, South Westerlies
  308. {
  309. TradeWindTendancy = (-North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  310. windDirectionNumb = 7;
  311. }
  312.  
  313. if (Latitude < -80 && Latitude >= -90) //Polar Cell, High Latitude, High Pressure, Southerlies
  314. {
  315. TradeWindTendancy = -North * (windSpeed * (float)CurrentAtmoPressure); //* RecipDeltaAtmoPressure);
  316. windDirectionNumb = 3;
  317. }
  318. }
  319.  
  320. else if (orbitingBodyName == "Laythe")
  321. {
  322. //Trade wind stuff below
  323. if (Latitude >= -5 && Latitude <= 5) //Easterly trade wind at the Inter-Tropical Convergence zone
  324. {
  325. //Debug.Log("Wind is Easterly!");
  326. //This area is nominally of lower pressure
  327. TradeWindTendancy = -East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  328. windDirectionNumb = 2;
  329. }
  330.  
  331. if (Latitude > 5 && Latitude <= 15) //Hadley Cell, North Easterly trade wind
  332. {
  333. TradeWindTendancy = (North + -East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  334. windDirectionNumb = 5;
  335. }
  336.  
  337. if (Latitude > 15 && Latitude <= 20) //Hadley Cell, Northerly trade wind.
  338. {
  339. TradeWindTendancy = North * (windSpeed * (float)CurrentAtmoPressure);// * RecipDeltaAtmoPressure);
  340. windDirectionNumb = 1;
  341. }
  342.  
  343. if (Latitude > 20 && Latitude <= 27) //Hadley Cell - Sub-Tropical Ridge, North Westerly trade wind
  344. {
  345. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  346. windDirectionNumb = 8;
  347. }
  348.  
  349. if (Latitude > 27 && Latitude <= 33) //Sub-tropical Ridge, Westerlies
  350. {
  351. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  352. windDirectionNumb = 4;
  353. }
  354.  
  355. if (Latitude > 33 && Latitude <= 40) //Sub-Tropical Ridge - Ferrel Cell, Mid-Latitude. Westerlies
  356. {
  357. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  358. windDirectionNumb = 4;
  359. }
  360.  
  361. if (Latitude > 40 && Latitude <= 80) //Ferrel Cell - Polar Cell/Vortex, High Latitude. High Pressure, North Westerlies
  362. {
  363. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  364. windDirectionNumb = 8;
  365. }
  366.  
  367. if (Latitude > 80 && Latitude <= 90) //Extreme high polar region, High Pressure, Northerlies
  368. {
  369. TradeWindTendancy = North * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  370. windDirectionNumb = 1;
  371. }
  372.  
  373.  
  374. //Southern hemisphere
  375. if (Latitude < -5 && Latitude >= -15) //ITCZ - Hadley Cell, South Easterlies
  376. {
  377. TradeWindTendancy = (-North + -East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  378. windDirectionNumb = 6;
  379. }
  380.  
  381. if (Latitude < -15 && Latitude >= -20) //Hadley Cell, Southerlies
  382. {
  383. TradeWindTendancy = -North * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  384. windDirectionNumb = 3;
  385. }
  386.  
  387. if (Latitude < -20 && Latitude >= -27) //Hadley Cell - Sub-Tropical Ridge, North Westerlies
  388. {
  389. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  390. windDirectionNumb = 7;
  391. }
  392.  
  393. if (Latitude < -27 && Latitude >= -33) //Sub-Tropical Ridge, Westerlies
  394. {
  395. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  396. windDirectionNumb = 4;
  397. }
  398.  
  399. if (Latitude < -33 && Latitude >= -40)//Sub-Tropical Ridge - Ferrel Cell, Westerlies
  400. {
  401. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); //* RecipDeltaAtmoPressure);
  402. windDirectionNumb = 4;
  403. }
  404.  
  405. if (Latitude < -40 && Latitude >= -80) //Ferrel Cell - Polar Cell/Vortex, High Latitude. High Pressure, South Westerlies
  406. {
  407. TradeWindTendancy = (-North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  408. windDirectionNumb = 7;
  409. }
  410.  
  411. if (Latitude < -80 && Latitude >= -90) //Polar Cell, High Latitude, High Pressure, Southerlies
  412. {
  413. TradeWindTendancy = -North * (windSpeed * (float)CurrentAtmoPressure); //* RecipDeltaAtmoPressure);
  414. windDirectionNumb = 3;
  415. }
  416. }
  417.  
  418. else if (orbitingBodyName == "Jool")
  419. {
  420. //Trade wind stuff below
  421. if (Latitude >= -5 && Latitude <= 5) //Easterly trade wind at the Inter-Tropical Convergence zone
  422. {
  423. //Debug.Log("Wind is Easterly!");
  424. //This area is nominally of lower pressure
  425. TradeWindTendancy = -East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  426. windDirectionNumb = 2;
  427. }
  428.  
  429. if (Latitude > 5 && Latitude <= 15) //Hadley Cell, North Easterly trade wind
  430. {
  431. TradeWindTendancy = (North + -East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  432. windDirectionNumb = 5;
  433. }
  434.  
  435. if (Latitude > 15 && Latitude <= 20) //Hadley Cell, Northerly trade wind.
  436. {
  437. TradeWindTendancy = North * (windSpeed * (float)CurrentAtmoPressure);// * RecipDeltaAtmoPressure);
  438. windDirectionNumb = 1;
  439. }
  440.  
  441. if (Latitude > 20 && Latitude <= 27) //Hadley Cell - Sub-Tropical Ridge, North Westerly trade wind
  442. {
  443. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  444. windDirectionNumb = 8;
  445. }
  446.  
  447. if (Latitude > 27 && Latitude <= 33) //Sub-tropical Ridge, Westerlies
  448. {
  449. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  450. windDirectionNumb = 4;
  451. }
  452.  
  453. if (Latitude > 33 && Latitude <= 40) //Sub-Tropical Ridge - Ferrel Cell, Mid-Latitude. Westerlies
  454. {
  455. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  456. windDirectionNumb = 4;
  457. }
  458.  
  459. if (Latitude > 40 && Latitude <= 80) //Ferrel Cell - Polar Cell/Vortex, High Latitude. High Pressure, North Westerlies
  460. {
  461. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  462. windDirectionNumb = 8;
  463. }
  464.  
  465. if (Latitude > 80 && Latitude <= 90) //Extreme high polar region, High Pressure, Northerlies
  466. {
  467. TradeWindTendancy = North * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  468. windDirectionNumb = 1;
  469. }
  470.  
  471.  
  472. //Southern hemisphere
  473. if (Latitude < -5 && Latitude >= -15) //ITCZ - Hadley Cell, South Easterlies
  474. {
  475. TradeWindTendancy = (-North + -East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  476. windDirectionNumb = 6;
  477. }
  478.  
  479. if (Latitude < -15 && Latitude >= -20) //Hadley Cell, Southerlies
  480. {
  481. TradeWindTendancy = -North * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  482. windDirectionNumb = 3;
  483. }
  484.  
  485. if (Latitude < -20 && Latitude >= -27) //Hadley Cell - Sub-Tropical Ridge, North Westerlies
  486. {
  487. TradeWindTendancy = (North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  488. windDirectionNumb = 7;
  489. }
  490.  
  491. if (Latitude < -27 && Latitude >= -33) //Sub-Tropical Ridge, Westerlies
  492. {
  493. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  494. windDirectionNumb = 4;
  495. }
  496.  
  497. if (Latitude < -33 && Latitude >= -40)//Sub-Tropical Ridge - Ferrel Cell, Westerlies
  498. {
  499. TradeWindTendancy = East * (windSpeed * (float)CurrentAtmoPressure); //* RecipDeltaAtmoPressure);
  500. windDirectionNumb = 4;
  501. }
  502.  
  503. if (Latitude < -40 && Latitude >= -80) //Ferrel Cell - Polar Cell/Vortex, High Latitude. High Pressure, South Westerlies
  504. {
  505. TradeWindTendancy = (-North + East).normalized * (windSpeed * (float)CurrentAtmoPressure); // * RecipDeltaAtmoPressure);
  506. windDirectionNumb = 7;
  507. }
  508.  
  509. if (Latitude < -80 && Latitude >= -90) //Polar Cell, High Latitude, High Pressure, Southerlies
  510. {
  511. TradeWindTendancy = -North * (windSpeed * (float)CurrentAtmoPressure); //* RecipDeltaAtmoPressure);
  512. windDirectionNumb = 3;
  513. }
  514. }
  515.  
  516. else
  517. {
  518. Debug.Log("KWS: Orbiting body doesn't contain atmosphere or has not been added to climate database");
  519. }
  520. return TradeWindTendancy;
  521. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement