-
Notifications
You must be signed in to change notification settings - Fork 3
/
solid_radius_helpers.cpp
2987 lines (2973 loc) · 164 KB
/
solid_radius_helpers.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "solid_radius_helpers.h"
#include "const.h"
#include "enviro.h"
#include "radius_tables.h"
#include "stargen.h"
#include "structs.h"
#include "utils.h"
#include <map>
using namespace std;
long double water_radius(long double mass, planet *the_planet, map<long double, long double> &mass_radii)
{
long double radius;
bool adjust_for_carbon;
long double radius1;
long double radius2;
if (mass <= 0.04663)
{
adjust_for_carbon = false;
radius1 = fraction_radius(mass, 1.0, 0, 0);
radius2 = planet_radius_helper(mass, 0.04663, mass_radii[0.04663], 0.06174, mass_radii[0.06174], 0.08208, mass_radii[0.08208]);
radius = rangeAdjust(mass, radius1, radius2, 0.0, 0.04663);
}
else if (mass <= 0.06174)
{
//radius = quad_trend(-16.65123034, 5.113560675, 0.3777603833, mass);
radius = planet_radius_helper(mass, 0.04663, mass_radii[0.04663], 0.06174, mass_radii[0.06174], 0.08208, mass_radii[0.08208]);
}
else if (mass <= 0.08208)
{
//radius = quad_trend(-10.36320636, 4.209217066, 0.4096256944, mass);
radius1 = planet_radius_helper(mass, 0.04663, mass_radii[0.04663], 0.06174, mass_radii[0.06174], 0.08208, mass_radii[0.08208]);
radius2 = planet_radius_helper(mass, 0.06174, mass_radii[0.06174], 0.08208, mass_radii[0.08208], 0.1091, mass_radii[0.1091]);
radius = rangeAdjust(mass, radius1, radius2, 0.06174, 0.08208);
}
else if (mass <= 0.1091)
{
//radius = quad_trend(-6.412939103, 3.454004972, 0.450000532, mass);
radius1 = planet_radius_helper(mass, 0.06174, mass_radii[0.06174], 0.08208, mass_radii[0.08208], 0.1091, mass_radii[0.1091]);
radius2 = planet_radius_helper(mass, 0.08208, mass_radii[0.08208], 0.1091, mass_radii[0.1091], 0.1445, mass_radii[0.1445]);
radius = rangeAdjust(mass, radius1, radius2, 0.08208, 0.1091);
}
else if (mass <= 0.1445)
{
//radius = quad_trend(-4.043947607, 2.853228729, 0.4823470857, mass);
radius1 = planet_radius_helper(mass, 0.08208, mass_radii[0.08208], 0.1091, mass_radii[0.1091], 0.1445, mass_radii[0.1445]);
radius2 = planet_radius_helper(mass, 0.1091, mass_radii[0.1091], 0.1445, mass_radii[0.1445], 0.1904, mass_radii[0.1904]);
radius = rangeAdjust(mass, radius1, radius2, 0.1091, 0.1445);
}
else if (mass <= 0.1904)
{
//radius = quad_trend(-2.574805682, 2.361213098, 0.5227672936, mass);
radius1 = planet_radius_helper(mass, 0.1091, mass_radii[0.1091], 0.1445, mass_radii[0.1445], 0.1904, mass_radii[0.1904]);
radius2 = planet_radius_helper(mass, 0.1445, mass_radii[0.1445], 0.1904, mass_radii[0.1904], 0.2494, mass_radii[0.2494]);
radius = rangeAdjust(mass, radius1, radius2, 0.1445, 0.1904);
}
else if (mass <= 0.2494)
{
//radius = quad_trend(-1.602739972, 1.933698599, 0.5689265727, mass);
radius1 = planet_radius_helper(mass, 0.1445, mass_radii[0.1445], 0.1904, mass_radii[0.1904], 0.2494, mass_radii[0.2494]);
radius2 = planet_radius_helper(mass, 0.1904, mass_radii[0.1904], 0.2494, mass_radii[0.2494], 0.3249, mass_radii[0.3249]);
radius = rangeAdjust(mass, radius1, radius2, 0.1904, 0.2494);
}
else if (mass <= 0.3249)
{
//radius = quad_trend(-1.096662911, 1.643058543, 0.6099340273, mass);
radius1 = planet_radius_helper(mass, 0.1904, mass_radii[0.1904], 0.2494, mass_radii[0.2494], 0.3249, mass_radii[0.3249]);
radius2 = planet_radius_helper(mass, 0.2494, mass_radii[0.2494], 0.3249, mass_radii[0.3249], 0.4206, mass_radii[0.4206]);
radius = rangeAdjust(mass, radius1, radius2, 0.2494, 0.3249);
}
else if (mass <= 0.4206)
{
//radius = quad_trend(-0.6439590656, 1.305567826, 0.6717973387, mass);
radius1 = planet_radius_helper(mass, 0.2494, mass_radii[0.2494], 0.3249, mass_radii[0.3249], 0.4206, mass_radii[0.4206]);
radius2 = planet_radius_helper(mass, 0.3249, mass_radii[0.3249], 0.4206, mass_radii[0.4206], 0.5416, mass_radii[0.5416]);
radius = rangeAdjust(mass, radius1, radius2, 0.3249, 0.4206);
}
else if (mass <= 0.5416)
{
//radius = quad_trend(-0.4425491256, 1.111771182, 0.7176779107, mass);
radius1 = planet_radius_helper(mass, 0.3249, mass_radii[0.3249], 0.4206, mass_radii[0.4206], 0.5416, mass_radii[0.5416]);
radius2 = planet_radius_helper(mass, 0.4206, mass_radii[0.4206], 0.5416, mass_radii[0.5416], 0.6938, mass_radii[0.6938]);
radius = rangeAdjust(mass, radius1, radius2, 0.4206, 0.5416);
}
else if (mass <= 0.6938)
{
//radius = quad_trend(-0.284756559, 0.9168342451, 0.7769703738, mass);
radius1 = planet_radius_helper(mass, 0.4206, mass_radii[0.4206], 0.5416, mass_radii[0.5416], 0.6938, mass_radii[0.6938]);
radius2 = planet_radius_helper(mass, 0.5416, mass_radii[0.5416], 0.6938, mass_radii[0.6938], 0.8866, mass_radii[0.8866]);
radius = rangeAdjust(mass, radius1, radius2, 0.5416, 0.6938);
}
else if (mass <= 0.8866)
{
//radius = quad_trend(-0.1818391485, 0.7541835695, 0.8402772483, mass);
radius1 = planet_radius_helper(mass, 0.5416, mass_radii[0.5416], 0.6938, mass_radii[0.6938], 0.8866, mass_radii[0.8866]);
radius2 = planet_radius_helper(mass, 0.6938, mass_radii[0.6938], 0.8866, mass_radii[0.8866], 1.132, mass_radii[1.132]);
radius = rangeAdjust(mass, radius1, radius2, 0.6938, 0.8866);
}
else if (mass <= 1.132)
{
//radius = quad_trend(-0.113751553, 0.6167419494, 0.9086120834, mass);
radius1 = planet_radius_helper(mass, 0.6938, mass_radii[0.6938], 0.8866, mass_radii[0.8866], 1.132, mass_radii[1.132]);
radius2 = planet_radius_helper(mass, 0.8866, mass_radii[0.8866], 1.132, mass_radii[1.132], 1.444, mass_radii[1.444]);
radius = rangeAdjust(mass, radius1, radius2, 0.8866, 1.132);
}
else if (mass <= 1.444)
{
//radius = quad_trend(-0.0764408154, 0.5206294893, 0.9696005136, mass);
radius1 = planet_radius_helper(mass, 0.8866, mass_radii[0.8866], 1.132, mass_radii[1.132], 1.444, mass_radii[1.444]);
radius2 = planet_radius_helper(mass, 1.132, mass_radii[1.132], 1.444, mass_radii[1.444], 1.841, mass_radii[1.841]);
radius = rangeAdjust(mass, radius1, radius2, 1.132, 1.444);
}
else if (mass <= 1.841)
{
//radius = quad_trend(-0.0507306367, 0.4361715523, 1.037948555, mass);
radius1 = planet_radius_helper(mass, 1.132, mass_radii[1.132], 1.444, mass_radii[1.444], 1.841, mass_radii[1.841]);
radius2 = planet_radius_helper(mass, 1.444, mass_radii[1.444], 1.841, mass_radii[1.841], 2.346, mass_radii[2.346]);
radius = rangeAdjust(mass, radius1, radius2, 1.444, 1.841);
}
else if (mass <= 2.346)
{
//radius = quad_trend(-0.0328093481, 0.3611351168, 1.11535035, mass);
radius1 = planet_radius_helper(mass, 1.444, mass_radii[1.444], 1.841, mass_radii[1.841], 2.346, mass_radii[2.346]);
radius2 = planet_radius_helper(mass, 1.841, mass_radii[1.841], 2.346, mass_radii[2.346], 2.985, mass_radii[2.985]);
radius = rangeAdjust(mass, radius1, radius2, 1.841, 2.346);
}
else if (mass <= 2.985)
{
//radius = quad_trend(-0.0216393745, 0.3015879874, 1.193571553, mass);
radius1 = planet_radius_helper(mass, 1.841, mass_radii[1.841], 2.346, mass_radii[2.346], 2.985, mass_radii[2.985]);
radius2 = planet_radius_helper(mass, 2.346, mass_radii[2.346], 2.985, mass_radii[2.985], 3.77, mass_radii[3.77]);
radius = rangeAdjust(mass, radius1, radius2, 2.346, 2.985);
}
else if (mass <= 3.77)
{
//radius = quad_trend(-0.0153809162, 0.2593121019, 1.2640008, mass);
radius1 = planet_radius_helper(mass, 2.346, mass_radii[2.346], 2.985, mass_radii[2.985], 3.77, mass_radii[3.77]);
radius2 = planet_radius_helper(mass, 2.985, mass_radii[2.985], 3.77, mass_radii[3.77], 4.735, mass_radii[4.735]);
radius = rangeAdjust(mass, radius1, radius2, 2.985, 3.77);
}
else if (mass <= 4.735)
{
//radius = quad_trend(-0.0094998772, 0.2092938647, 1.368982934, mass);
radius1 = planet_radius_helper(mass, 2.985, mass_radii[2.985], 3.77, mass_radii[3.77], 4.735, mass_radii[4.735]);
radius2 = planet_radius_helper(mass, 3.77, mass_radii[3.77], 4.735, mass_radii[4.735], 5.909, mass_radii[5.909]);
radius = rangeAdjust(mass, radius1, radius2, 3.77, 4.735);
}
else if (mass <= 5.909)
{
//radius = quad_trend(-0.0071381878, 0.1841560435, 1.435060912, mass);
radius1 = planet_radius_helper(mass, 3.77, mass_radii[3.77], 4.735, mass_radii[4.735], 5.909, mass_radii[5.909]);
radius2 = planet_radius_helper(mass, 4.735, mass_radii[4.735], 5.909, mass_radii[5.909], 7.325, mass_radii[7.325]);
radius = rangeAdjust(mass, radius1, radius2, 4.735, 5.909);
}
else if (mass <= 7.325)
{
//radius = quad_trend(-0.0047831757, 0.1529898131, 1.536993902, mass);
radius1 = planet_radius_helper(mass, 4.735, mass_radii[4.735], 5.909, mass_radii[5.909], 7.325, mass_radii[7.325]);
radius2 = planet_radius_helper(mass, 5.909, mass_radii[5.909], 7.325, mass_radii[7.325], 9.038, mass_radii[9.038]);
radius = rangeAdjust(mass, radius1, radius2, 5.909, 7.325);
}
else if (mass <= 9.038)
{
//radius = quad_trend(-0.0030379843, 0.1244332454, 1.652531423, mass);
radius1 = planet_radius_helper(mass, 5.909, mass_radii[5.909], 7.325, mass_radii[7.325], 9.038, mass_radii[9.038]);
radius2 = planet_radius_helper(mass, 7.325, mass_radii[7.325], 9.038, mass_radii[9.038], 11.11, mass_radii[11.11]);
radius = rangeAdjust(mass, radius1, radius2, 7.325, 9.038);
}
else if (mass <= 11.11)
{
//radius = quad_trend(-0.0022950101, 0.1094638026, 1.727135075, mass);
radius1 = planet_radius_helper(mass, 7.325, mass_radii[7.325], 9.038, mass_radii[9.038], 11.11, mass_radii[11.11]);
radius2 = planet_radius_helper(mass, 9.038, mass_radii[9.038], 11.11, mass_radii[11.11], 13.55, mass_radii[13.55]);
radius = rangeAdjust(mass, radius1, radius2, 9.038, 11.11);
}
else if (mass <= 13.55)
{
//radius = quad_trend(-0.0016885901, 0.0945094843, 1.818425851, mass);
radius1 = planet_radius_helper(mass, 9.038, mass_radii[9.038], 11.11, mass_radii[11.11], 13.55, mass_radii[13.55]);
radius2 = planet_radius_helper(mass, 11.11, mass_radii[11.11], 13.55, mass_radii[13.55], 16.42, mass_radii[16.42]);
radius = rangeAdjust(mass, radius1, radius2, 11.11, 13.55);
}
else if (mass <= 16.42)
{
//radius = quad_trend(-0.0011073173, 0.0770887387, 1.947753816, mass);
radius1 = planet_radius_helper(mass, 11.11, mass_radii[11.11], 13.55, mass_radii[13.55], 16.42, mass_radii[16.42]);
radius2 = planet_radius_helper(mass, 13.55, mass_radii[13.55], 16.42, mass_radii[16.42], 19.77, mass_radii[19.77]);
radius = rangeAdjust(mass, radius1, radius2, 13.55, 16.42);
}
else if (mass <= 19.77)
{
//radius = quad_trend(-8.359E-4, 0.0672661454, 2.035862234, mass);
radius1 = planet_radius_helper(mass, 13.55, mass_radii[13.55], 16.42, mass_radii[16.42], 19.77, mass_radii[19.77]);
radius2 = planet_radius_helper(mass, 16.42, mass_radii[16.42], 19.77, mass_radii[19.77], 23.68, mass_radii[23.68]);
radius = rangeAdjust(mass, radius1, radius2, 16.42, 19.77);
}
else if (mass <= 23.68)
{
//radius = quad_trend(-5.802993E-4, 0.0561602979, 2.15552259, mass);
radius1 = planet_radius_helper(mass, 16.42, mass_radii[16.42], 19.77, mass_radii[19.77], 23.68, mass_radii[23.68]);
radius2 = planet_radius_helper(mass, 19.77, mass_radii[19.77], 23.68, mass_radii[23.68], 28.21, mass_radii[28.21]);
radius = rangeAdjust(mass, radius1, radius2, 19.77, 23.68);
}
else if (mass <= 28.21)
{
//radius = quad_trend(-4.35093E-4, 0.0486255396, 2.252522301, mass);
radius1 = planet_radius_helper(mass, 19.77, mass_radii[19.77], 23.68, mass_radii[23.68], 28.21, mass_radii[28.21]);
radius2 = planet_radius_helper(mass, 23.68, mass_radii[23.68], 28.21, mass_radii[28.21], 33.49, mass_radii[33.49]);
radius = rangeAdjust(mass, radius1, radius2, 23.68, 28.21);
}
else if (mass <= 33.49)
{
//radius = quad_trend(-2.932841E-4, 0.0398759318, 2.38649665, mass);
radius1 = planet_radius_helper(mass, 23.68, mass_radii[23.68], 28.21, mass_radii[28.21], 33.49, mass_radii[33.49]);
radius2 = planet_radius_helper(mass, 28.21, mass_radii[28.21], 33.49, mass_radii[33.49], 39.62, mass_radii[39.62]);
radius = rangeAdjust(mass, radius1, radius2, 28.21, 33.49);
}
else if (mass <= 39.62)
{
//radius = quad_trend(-2.222958E-4, 0.0346859791, 2.480689131, mass);
radius1 = planet_radius_helper(mass, 28.21, mass_radii[28.21], 33.49, mass_radii[33.49], 39.62, mass_radii[39.62]);
radius2 = planet_radius_helper(mass, 33.49, mass_radii[33.49], 39.62, mass_radii[39.62], 46.72, mass_radii[46.72]);
radius = rangeAdjust(mass, radius1, radius2, 33.49, 39.62);
}
else if (mass <= 46.72)
{
//radius = quad_trend(-1.517795E-4, 0.028597598, 2.611218155, mass);
radius1 = planet_radius_helper(mass, 33.49, mass_radii[33.49], 39.62, mass_radii[39.62], 46.72, mass_radii[46.72]);
radius2 = planet_radius_helper(mass, 39.62, mass_radii[39.62], 46.72, mass_radii[46.72], 54.92, mass_radii[54.92]);
radius = rangeAdjust(mass, radius1, radius2, 39.62, 46.72);
}
else if (mass <= 54.92)
{
//radius = quad_trend(-1.258851E-4, 0.0259656963, 2.677659493, mass);
radius1 = planet_radius_helper(mass, 39.62, mass_radii[39.62], 46.72, mass_radii[46.72], 54.92, mass_radii[54.92]);
radius2 = planet_radius_helper(mass, 46.72, mass_radii[46.72], 54.92, mass_radii[54.92], 64.22, mass_radii[64.22]);
radius = rangeAdjust(mass, radius1, radius2, 46.72, 54.92);
}
else if (mass <= 64.22)
{
//radius = quad_trend(-8.536582E-5, 0.0211382252, 2.820569591, mass);
radius1 = planet_radius_helper(mass, 46.72, mass_radii[46.72], 54.92, mass_radii[54.92], 64.22, mass_radii[64.22]);
radius2 = planet_radius_helper(mass, 54.92, mass_radii[54.92], 64.22, mass_radii[64.22], 74.79, mass_radii[74.79]);
radius = rangeAdjust(mass, radius1, radius2, 54.92, 64.22);
}
else if (mass <= 74.79)
{
//radius = quad_trend(-6.893859E-5, 0.0188546772, 2.899469761, mass);
radius1 = planet_radius_helper(mass, 54.92, mass_radii[54.92], 64.22, mass_radii[64.22], 74.79, mass_radii[74.79]);
radius2 = planet_radius_helper(mass, 64.22, mass_radii[64.22], 74.79, mass_radii[74.79], 86.85, mass_radii[86.85]);
radius = rangeAdjust(mass, radius1, radius2, 64.22, 74.79);
}
else if (mass <= 86.85)
{
//radius = quad_trend(-4.872761E-5, 0.0155877735, 3.030750451, mass);
radius1 = planet_radius_helper(mass, 64.22, mass_radii[64.22], 74.79, mass_radii[74.79], 86.85, mass_radii[86.85]);
radius2 = planet_radius_helper(mass, 74.79, mass_radii[74.79], 86.85, mass_radii[86.85], 100.3, mass_radii[100.3]);
radius = rangeAdjust(mass, radius1, radius2, 74.79, 86.85);
}
else if (mass <= 100.3)
{
//radius = quad_trend(-4.224024E-5, 0.0143736624, 3.087262279, mass);
radius1 = planet_radius_helper(mass, 74.79, mass_radii[74.79], 86.85, mass_radii[86.85], 100.3, mass_radii[100.3]);
radius2 = planet_radius_helper(mass, 86.85, mass_radii[86.85], 100.3, mass_radii[100.3], 115.3, mass_radii[115.3]);
radius = rangeAdjust(mass, radius1, radius2, 86.85, 100.3);
}
else if (mass <= 115.3)
{
//radius = quad_trend(-2.750241E-5, 0.0111961873, 3.257699183, mass);
radius1 = planet_radius_helper(mass, 86.85, mass_radii[86.85], 100.3, mass_radii[100.3], 115.3, mass_radii[115.3]);
radius2 = planet_radius_helper(mass, 100.3, mass_radii[100.3], 115.3, mass_radii[115.3], 131.9, mass_radii[131.9]);
radius = rangeAdjust(mass, radius1, radius2, 100.3, 115.3);
}
else if (mass <= 131.9)
{
//radius = quad_trend(-2.316097E-5, 0.0101229814, 3.323724226, mass);
radius1 = planet_radius_helper(mass, 100.3, mass_radii[100.3], 115.3, mass_radii[115.3], 131.9, mass_radii[131.9]);
radius2 = planet_radius_helper(mass, 115.3, mass_radii[115.3], 131.9, mass_radii[131.9], 150.3, mass_radii[150.3]);
radius = rangeAdjust(mass, radius1, radius2, 115.3, 131.9);
}
else if (mass <= 150.3)
{
//radius = quad_trend(-1.696985E-5, 0.0083758488, 3.44646041, mass);
radius1 = planet_radius_helper(mass, 115.3, mass_radii[115.3], 131.9, mass_radii[131.9], 150.3, mass_radii[150.3]);
radius2 = planet_radius_helper(mass, 131.9, mass_radii[131.9], 150.3, mass_radii[150.3], 170.8, mass_radii[170.8]);
radius = rangeAdjust(mass, radius1, radius2, 131.9, 150.3);
}
else if (mass <= 170.8)
{
//radius = quad_trend(-1.390919E-5, 0.0073930697, 3.525031443, mass);
radius1 = planet_radius_helper(mass, 131.9, mass_radii[131.9], 150.3, mass_radii[150.3], 170.8, mass_radii[170.8]);
radius2 = planet_radius_helper(mass, 150.3, mass_radii[150.3], 170.8, mass_radii[170.8], 193.6, mass_radii[193.6]);
radius = rangeAdjust(mass, radius1, radius2, 150.3, 170.8);
}
else if (mass <= 193.6)
{
//radius = quad_trend(-8.605654E-6, 0.0054604616, 3.700402798, mass);
radius1 = planet_radius_helper(mass, 150.3, mass_radii[150.3], 170.8, mass_radii[170.8], 193.6, mass_radii[193.6]);
radius2 = planet_radius_helper(mass, 170.8, mass_radii[170.8], 193.6, mass_radii[193.6], 218.7, mass_radii[218.7]);
radius = rangeAdjust(mass, radius1, radius2, 170.8, 193.6);
}
else if (mass <= 218.7)
{
//radius = quad_trend(-7.67876E-6, 0.0050783031, 3.73964779, mass);
radius1 = planet_radius_helper(mass, 170.8, mass_radii[170.8], 193.6, mass_radii[193.6], 218.7, mass_radii[218.7]);
radius2 = planet_radius_helper(mass, 193.6, mass_radii[193.6], 218.7, mass_radii[218.7], 246.6, mass_radii[246.6]);
radius = rangeAdjust(mass, radius1, radius2, 193.6, 218.7);
}
else if (mass <= 246.6)
{
//radius = quad_trend(-5.678121E-6, 0.0041474062, 3.847545049, mass);
radius1 = planet_radius_helper(mass, 193.6, mass_radii[193.6], 218.7, mass_radii[218.7], 246.6, mass_radii[246.6]);
radius2 = planet_radius_helper(mass, 218.7, mass_radii[218.7], 246.6, mass_radii[246.6], 277.3, mass_radii[277.3]);
radius = rangeAdjust(mass, radius1, radius2, 218.7, 246.6);
}
else if (mass <= 277.3)
{
//radius = quad_trend(-4.032051E-6, 0.0032850302, 3.960106892, mass);
radius1 = planet_radius_helper(mass, 218.7, mass_radii[218.7], 246.6, mass_radii[246.6], 277.3, mass_radii[277.3]);
radius2 = planet_radius_helper(mass, 246.6, mass_radii[246.6], 277.3, mass_radii[277.3], 311.3, mass_radii[311.3]);
radius = rangeAdjust(mass, radius1, radius2, 246.6, 277.3);
}
else if (mass <= 311.3)
{
//radius = quad_trend(-3.033299E-6, 0.0026971644, 4.046322701, mass);
radius1 = planet_radius_helper(mass, 246.6, mass_radii[246.6], 277.3, mass_radii[277.3], 311.3, mass_radii[311.3]);
radius2 = planet_radius_helper(mass, 277.3, mass_radii[277.3], 311.3, mass_radii[311.3], 348.7, mass_radii[348.7]);
radius = rangeAdjust(mass, radius1, radius2, 277.3, 311.3);
}
else if (mass <= 348.7)
{
//radius = quad_trend(-2.385035E-6, 0.0022693105, 4.116691904, mass);
radius1 = planet_radius_helper(mass, 277.3, mass_radii[277.3], 311.3, mass_radii[311.3], 348.7, mass_radii[348.7]);
radius2 = planet_radius_helper(mass, 311.3, mass_radii[311.3], 348.7, mass_radii[348.7], 390.1, mass_radii[390.1]);
radius = rangeAdjust(mass, radius1, radius2, 277.3, 311.3);
}
else if (mass <= 390.1)
{
//radius = quad_trend(-1.560405E-6, 0.0016600738, 4.228864586, mass);
radius1 = planet_radius_helper(mass, 311.3, mass_radii[311.3], 348.7, mass_radii[348.7], 390.1, mass_radii[390.1]);
radius2 = planet_radius_helper(mass, 348.7, mass_radii[348.7], 390.1, mass_radii[390.1], 435.9, mass_radii[435.9]);
radius = rangeAdjust(mass, radius1, radius2, 311.3, 390.1);
}
else if (mass <= 435.9)
{
//radius = quad_trend(-1.181239E-6, 0.0013468823, 4.293339789, mass);
radius1 = planet_radius_helper(mass, 348.7, mass_radii[348.7], 390.1, mass_radii[390.1], 435.9, mass_radii[435.9]);
radius2 = planet_radius_helper(mass, 390.1, mass_radii[390.1], 435.9, mass_radii[435.9], 486.4, mass_radii[486.4]);
radius = rangeAdjust(mass, radius1, radius2, 390.1, 435.9);
}
else if (mass <= 486.4)
{
radius1 = planet_radius_helper(mass, 390.1, mass_radii[390.1], 435.9, mass_radii[435.9], 486.4, mass_radii[486.4]);
radius2 = planet_radius_helper2(mass, 435.9, mass_radii[435.9], 486.4, mass_radii[486.4]);
radius = rangeAdjust(mass, radius1, radius2, 390.1, 435.9);
}
else
{
//radius = ln_trend(3.935260455, 0.1185931516, mass);
//radius = rangeAdjust(mass, radius1, radius2, 390.1, 435.9);
radius = planet_radius_helper2(mass, 435.9, mass_radii[435.9], 486.4, mass_radii[486.4]);
}
if (flag_verbose & 0x80000)
{
radiusDebug("100% water/ice", the_planet, radius, mass_radii);
}
return radius;
}
long double one_quater_rock_three_fourths_water_radius(long double mass, long double cmf, planet *the_planet, map<long double, long double> &mass_radii)
{
long double radius;
long double radius1;
long double radius2;
bool adjust_for_carbon;
long double carbon_fraction;
long double grow_factor;
long double rmf;
adjust_for_carbon = true;
rmf = 0.25;
if (mass <= 0.01217)
{
radius1 = fraction_radius(mass, 0.75, 0.25, cmf);
radius2 = planet_radius_helper(mass, 0.01217, mass_radii[0.01217], 0.01699, mass_radii[0.01699], 0.02351, mass_radii[0.02351]);
radius = rangeAdjust(mass, radius1, radius2, 0.0, 0.01217);
}
else if (mass <= 0.01699)
{
//radius = quad_trend(-146.895671, 12.43700474, 0.2319982086, mass);
radius = planet_radius_helper(mass, 0.01217, mass_radii[0.01217], 0.01699, mass_radii[0.01699], 0.02351, mass_radii[0.02351]);
}
else if (mass <= 0.02351)
{
//radius = quad_trend(-93.66740376, 10.28125991, 0.2532594362, mass);
radius1 = planet_radius_helper(mass, 0.01217, mass_radii[0.01217], 0.01699, mass_radii[0.01699], 0.02351, mass_radii[0.02351]);
radius2 = planet_radius_helper(mass, 0.01699, mass_radii[0.01699], 0.02351, mass_radii[0.02351], 0.03213, mass_radii[0.03213]);
radius = rangeAdjust(mass, radius1, radius2, 0.01699, 0.02351);
}
else if (mass <= 0.03213)
{
//radius = quad_trend(-49.50958629, 7.82431895, 0.286615205, mass);
radius1 = planet_radius_helper(mass, 0.01699, mass_radii[0.01699], 0.02351, mass_radii[0.02351], 0.03213, mass_radii[0.03213]);
radius2 = planet_radius_helper(mass, 0.02351, mass_radii[0.02351], 0.03213, mass_radii[0.03213], 0.04399, mass_radii[0.04399]);
radius = rangeAdjust(mass, radius1, radius2, 0.02351, 0.03213);
}
else if (mass <= 0.04399)
{
//radius = quad_trend(-28.55523788, 6.229273949, 0.3162320538, mass);
radius1 = planet_radius_helper(mass, 0.02351, mass_radii[0.02351], 0.03213, mass_radii[0.03213], 0.04399, mass_radii[0.04399]);
radius2 = planet_radius_helper(mass, 0.03213, mass_radii[0.03213], 0.04399, mass_radii[0.04399], 0.06029, mass_radii[0.06029]);
radius = rangeAdjust(mass, radius1, radius2, 0.03213, 0.04399);
}
else if (mass <= 0.06029)
{
//radius = quad_trend(-16.6356548, 4.986299825, 0.3478446607, mass);
radius1 = planet_radius_helper(mass, 0.03213, mass_radii[0.03213], 0.04399, mass_radii[0.04399], 0.06029, mass_radii[0.06029]);
radius2 = planet_radius_helper(mass, 0.04399, mass_radii[0.04399], 0.06029, mass_radii[0.06029], 0.08255, mass_radii[0.08255]);
radius = rangeAdjust(mass, radius1, radius2, 0.04399, 0.06029);
}
else if (mass <= 0.08255)
{
//radius = quad_trend(-9.804944764, 4.010601203, 0.3818406913, mass);
radius1 = planet_radius_helper(mass, 0.04399, mass_radii[0.04399], 0.06029, mass_radii[0.06029], 0.08255, mass_radii[0.08255]);
radius2 = planet_radius_helper(mass, 0.06029, mass_radii[0.06029], 0.08255, mass_radii[0.08255], 0.1127, mass_radii[0.1127]);
radius = rangeAdjust(mass, radius1, radius2, 0.06029, 0.08255);
}
else if (mass <= 0.1127)
{
//radius = quad_trend(-5.815642034, 3.231689845, 0.4189547105, mass);
radius1 = planet_radius_helper(mass, 0.06029, mass_radii[0.06029], 0.08255, mass_radii[0.08255], 0.1127, mass_radii[0.1127]);
radius2 = planet_radius_helper(mass, 0.08255, mass_radii[0.08255], 0.1127, mass_radii[0.1127], 0.1533, mass_radii[0.1533]);
radius = rangeAdjust(mass, radius1, radius2, 0.08255, 0.1127);
}
else if (mass <= 0.1533)
{
//radius = quad_trend(-3.502419815, 2.616372735, 0.4589200426, mass);
radius1 = planet_radius_helper(mass, 0.08255, mass_radii[0.08255], 0.1127, mass_radii[0.1127], 0.1533, mass_radii[0.1533]);
radius2 = planet_radius_helper(mass, 0.1127, mass_radii[0.1127], 0.1533, mass_radii[0.1533], 0.2074, mass_radii[0.2074]);
radius = rangeAdjust(mass, radius1, radius2, 0.1127, 0.1533);
}
else if (mass <= 0.2074)
{
//radius = quad_trend(-2.087108413, 2.105869912, 0.5039190477, mass);
radius1 = planet_radius_helper(mass, 0.1127, mass_radii[0.1127], 0.1533, mass_radii[0.1533], 0.2074, mass_radii[0.2074]);
radius2 = planet_radius_helper(mass, 0.1533, mass_radii[0.1533], 0.2074, mass_radii[0.2074], 0.2789, mass_radii[0.2789]);
radius = rangeAdjust(mass, radius1, radius2, 0.1533, 0.2074);
}
else if (mass <= 0.2789)
{
//radius = quad_trend(-1.299687957, 1.722947345, 0.5494664863, mass);
radius1 = planet_radius_helper(mass, 0.1533, mass_radii[0.1533], 0.2074, mass_radii[0.2074], 0.2789, mass_radii[0.2789]);
radius2 = planet_radius_helper(mass, 0.2074, mass_radii[0.2074], 0.2789, mass_radii[0.2789], 0.3726, mass_radii[0.3726]);
radius = rangeAdjust(mass, radius1, radius2, 0.2074, 0.2789);
}
else if (mass <= 0.3726)
{
//radius = quad_trend(-0.7560773586, 1.368785039, 0.6059574886, mass);
radius1 = planet_radius_helper(mass, 0.2074, mass_radii[0.2074], 0.2789, mass_radii[0.2789], 0.3726, mass_radii[0.3726]);
radius2 = planet_radius_helper(mass, 0.2789, mass_radii[0.2789], 0.3726, mass_radii[0.3726], 0.4946, mass_radii[0.4946]);
radius = rangeAdjust(mass, radius1, radius2, 0.2789, 0.3726);
}
else if (mass <= 0.4946)
{
//radius = quad_trend(-0.5024408471, 1.148831457, 0.6526996439, mass);
radius1 = planet_radius_helper(mass, 0.2789, mass_radii[0.2789], 0.3726, mass_radii[0.3726], 0.4946, mass_radii[0.4946]);
radius2 = planet_radius_helper(mass, 0.3726, mass_radii[0.3726], 0.4946, mass_radii[0.4946], 0.6517, mass_radii[0.6517]);
radius = rangeAdjust(mass, radius1, radius2, 0.3726, 0.4946);
}
else if (mass <= 0.6517)
{
//radius = quad_trend(-0.2949670516, 0.911004245, 0.7195748425, mass);
radius1 = planet_radius_helper(mass, 0.3726, mass_radii[0.3726], 0.4946, mass_radii[0.4946], 0.6517, mass_radii[0.6517]);
radius2 = planet_radius_helper(mass, 0.4946, mass_radii[0.4946], 0.6517, mass_radii[0.6517], 0.8529, mass_radii[0.8529]);
radius = rangeAdjust(mass, radius1, radius2, 0.4946, 0.6517);
}
else if (mass <= 0.8529)
{
//radius = quad_trend(-0.179050929, 0.7365968468, 0.7840050724, mass);
radius1 = planet_radius_helper(mass, 0.4946, mass_radii[0.4946], 0.6517, mass_radii[0.6517], 0.8529, mass_radii[0.8529]);
radius2 = planet_radius_helper(mass, 0.6517, mass_radii[0.6517], 0.8529, mass_radii[0.8529], 1.107, mass_radii[1.107]);
radius = rangeAdjust(mass, radius1, radius2, 0.6517, 0.8529);
}
else if (mass <= 1.107)
{
//radius = quad_trend(-0.1336109642, 0.6475390598, 0.8269076832, mass);
radius1 = planet_radius_helper(mass, 0.6517, mass_radii[0.6517], 0.8529, mass_radii[0.8529], 1.107, mass_radii[1.107]);
radius2 = planet_radius_helper(mass, 0.8529, mass_radii[0.8529], 1.107, mass_radii[1.107], 1.42, mass_radii[1.42]);
radius = rangeAdjust(mass, radius1, radius2, 0.8529, 1.107);
}
else if (mass <= 1.42)
{
//radius = quad_trend(-0.0718849276, 0.4915573653, 0.9239373092, mass);
radius1 = planet_radius_helper(mass, 0.8529, mass_radii[0.8529], 1.107, mass_radii[1.107], 1.42, mass_radii[1.42]);
radius2 = planet_radius_helper(mass, 1.107, mass_radii[1.107], 1.42, mass_radii[1.42], 1.818, mass_radii[1.818]);
radius = rangeAdjust(mass, radius1, radius2, 1.107, 1.42);
}
else if (mass <= 1.818)
{
//radius = quad_trend(-0.0489259048, 0.4172160496, 0.983207404, mass);
radius1 = planet_radius_helper(mass, 1.107, mass_radii[1.107], 1.42, mass_radii[1.42], 1.818, mass_radii[1.818]);
radius2 = planet_radius_helper(mass, 1.42, mass_radii[1.42], 1.818, mass_radii[1.818], 2.321, mass_radii[2.321]);
radius = rangeAdjust(mass, radius1, radius2, 1.42, 1.818);
}
else if (mass <= 2.321)
{
//radius = quad_trend(-0.0311382323, 0.3435928732, 1.058263876, mass);
radius1 = planet_radius_helper(mass, 1.42, mass_radii[1.42], 1.818, mass_radii[1.818], 2.321, mass_radii[2.321]);
radius2 = planet_radius_helper(mass, 1.818, mass_radii[1.818], 2.321, mass_radii[2.321], 2.957, mass_radii[2.957]);
radius = rangeAdjust(mass, radius1, radius2, 1.818, 2.321);
}
else if (mass <= 2.957)
{
//radius = quad_trend(-0.0215357163, 0.2929107938, 1.124167834, mass);
radius1 = planet_radius_helper(mass, 1.818, mass_radii[1.818], 2.321, mass_radii[2.321], 2.957, mass_radii[2.957]);
radius2 = planet_radius_helper(mass, 2.321, mass_radii[2.321], 2.957, mass_radii[2.957], 3.752, mass_radii[3.752]);
radius = rangeAdjust(mass, radius1, radius2, 2.321, 2.957);
}
else if (mass <= 3.752)
{
//radius = quad_trend(-0.0140610057, 0.2427629605, 1.207097237, mass);
radius1 = planet_radius_helper(mass, 2.321, mass_radii[2.321], 2.957, mass_radii[2.957], 3.752, mass_radii[3.752]);
radius2 = planet_radius_helper(mass, 2.957, mass_radii[2.957], 3.752, mass_radii[3.752], 4.732, mass_radii[4.732]);
radius = rangeAdjust(mass, radius1, radius2, 2.957, 3.752);
}
else if (mass <= 4.732)
{
//radius = quad_trend(-0.0097572891, 0.2062502282, 1.28350742, mass);
radius1 = planet_radius_helper(mass, 2.957, mass_radii[2.957], 3.752, mass_radii[3.752], 4.732, mass_radii[4.732]);
radius2 = planet_radius_helper(mass, 3.752, mass_radii[3.752], 4.732, mass_radii[4.732], 5.936, mass_radii[5.936]);
radius = rangeAdjust(mass, radius1, radius2, 3.752, 4.732);
}
else if (mass <= 5.936)
{
//radius = quad_trend(-0.0064236493, 0.1706869588, 1.377146535, mass);
radius1 = planet_radius_helper(mass, 3.752, mass_radii[3.752], 4.732, mass_radii[4.732], 5.936, mass_radii[5.936]);
radius2 = planet_radius_helper(mass, 4.732, mass_radii[4.732], 5.936, mass_radii[5.936], 7.407, mass_radii[7.407]);
radius = rangeAdjust(mass, radius1, radius2, 4.732, 5.936);
}
else if (mass <= 7.407)
{
//radius = quad_trend(-0.0044017468, 0.1437087145, 1.466045444, mass);
radius1 = planet_radius_helper(mass, 4.732, mass_radii[4.732], 5.936, mass_radii[5.936], 7.407, mass_radii[7.407]);
radius2 = planet_radius_helper(mass, 5.936, mass_radii[5.936], 7.407, mass_radii[7.407], 9.127, mass_radii[9.127]);
radius = rangeAdjust(mass, radius1, radius2, 5.936, 7.407);
}
else if (mass <= 9.127)
{
//radius = quad_trend(-0.0031572872, 0.1231328187, 1.550175507, mass);
radius1 = planet_radius_helper(mass, 5.936, mass_radii[5.936], 7.407, mass_radii[7.407], 9.127, mass_radii[9.127]);
radius2 = planet_radius_helper(mass, 7.407, mass_radii[7.407], 9.127, mass_radii[9.127], 11.12, mass_radii[11.12]);
radius = rangeAdjust(mass, radius1, radius2, 7.407, 9.127);
}
else if (mass <= 11.12)
{
//radius = quad_trend(-0.0022855813, 0.1054833897, 1.63864689, mass);
radius1 = planet_radius_helper(mass, 7.407, mass_radii[7.407], 9.127, mass_radii[9.127], 11.12, mass_radii[11.12]);
radius2 = planet_radius_helper(mass, 9.127, mass_radii[9.127], 11.12, mass_radii[11.12], 13.52, mass_radii[13.52]);
radius = rangeAdjust(mass, radius1, radius2, 9.127, 11.12);
}
else if (mass <= 13.52)
{
//radius = quad_trend(-0.0014786967, 0.0856017544, 1.75995585, mass);
radius1 = planet_radius_helper(mass, 9.127, mass_radii[9.127], 11.12, mass_radii[11.12], 13.52, mass_radii[13.52]);
radius2 = planet_radius_helper(mass, 11.12, mass_radii[11.12], 13.52, mass_radii[13.52], 16.37, mass_radii[16.37]);
radius = rangeAdjust(mass, radius1, radius2, 11.12, 13.52);
}
else if (mass <= 16.37)
{
//radius = quad_trend(-0.0010448606, 0.0726343917, 1.855973509, mass);
radius1 = planet_radius_helper(mass, 11.12, mass_radii[11.12], 13.52, mass_radii[13.52], 16.37, mass_radii[16.37]);
radius2 = planet_radius_helper(mass, 13.52, mass_radii[13.52], 16.37, mass_radii[16.37], 19.72, mass_radii[19.72]);
radius = rangeAdjust(mass, radius1, radius2, 13.52, 16.37);
}
else if (mass <= 19.72)
{
//radius = quad_trend(-7.705122E-4, 0.0627331568, 1.944537682, mass);
radius1 = planet_radius_helper(mass, 13.52, mass_radii[13.52], 16.37, mass_radii[16.37], 19.72, mass_radii[19.72]);
radius2 = planet_radius_helper(mass, 16.37, mass_radii[16.37], 19.72, mass_radii[19.72], 23.68, mass_radii[23.68]);
radius = rangeAdjust(mass, radius1, radius2, 16.37, 19.72);
}
else if (mass <= 23.68)
{
//radius = quad_trend(-5.689036E-4, 0.0539833448, 2.038682756, mass);
radius1 = planet_radius_helper(mass, 16.37, mass_radii[16.37], 19.72, mass_radii[19.72], 23.68, mass_radii[23.68]);
radius2 = planet_radius_helper(mass, 19.72, mass_radii[19.72], 23.68, mass_radii[23.68], 28.31, mass_radii[28.31]);
radius = rangeAdjust(mass, radius1, radius2, 19.72, 23.68);
}
else if (mass <= 28.31)
{
//radius = quad_trend(-3.838975E-4, 0.0443648787, 2.162707279, mass);
radius1 = planet_radius_helper(mass, 19.72, mass_radii[19.72], 23.68, mass_radii[23.68], 28.31, mass_radii[28.31]);
radius2 = planet_radius_helper(mass, 23.68, mass_radii[23.68], 28.31, mass_radii[28.31], 33.71, mass_radii[33.71]);
radius = rangeAdjust(mass, radius1, radius2, 19.72, 23.68);
}
else if (mass <= 33.71)
{
//radius = quad_trend(-2.832898E-4, 0.0381251907, 2.258720213, mass);
radius1 = planet_radius_helper(mass, 23.68, mass_radii[23.68], 28.31, mass_radii[28.31], 33.71, mass_radii[33.71]);
radius2 = planet_radius_helper(mass, 28.31, mass_radii[28.31], 33.71, mass_radii[33.71], 39.97, mass_radii[39.97]);
radius = rangeAdjust(mass, radius1, radius2, 19.72, 23.68);
}
else if (mass <= 39.97)
{
//radius = quad_trend(-2.059313E-4, 0.0324254134, 2.362952236, mass);
radius1 = planet_radius_helper(mass, 28.31, mass_radii[28.31], 33.71, mass_radii[33.71], 39.97, mass_radii[39.97]);
radius2 = planet_radius_helper(mass, 33.71, mass_radii[33.71], 39.97, mass_radii[39.97], 47.15, mass_radii[47.15]);
radius = rangeAdjust(mass, radius1, radius2, 23.68, 39.97);
}
else if (mass <= 47.15)
{
//radius = quad_trend(-1.453571E-4, 0.027148189, 2.477109496, mass);
radius1 = planet_radius_helper(mass, 33.71, mass_radii[33.71], 39.97, mass_radii[39.97], 47.15, mass_radii[47.15]);
radius2 = planet_radius_helper(mass, 39.97, mass_radii[39.97], 47.15, mass_radii[47.15], 55.31, mass_radii[55.31]);
radius = rangeAdjust(mass, radius1, radius2, 39.97, 47.15);
}
else if (mass <= 55.31)
{
//radius = quad_trend(-1.213663E-4, 0.0246900884, 2.539674382, mass);
radius1 = planet_radius_helper(mass, 39.97, mass_radii[39.97], 47.15, mass_radii[47.15], 55.31, mass_radii[55.31]);
radius2 = planet_radius_helper(mass, 47.15, mass_radii[47.15], 55.31, mass_radii[55.31], 64.47, mass_radii[64.47]);
radius = rangeAdjust(mass, radius1, radius2, 47.15, 55.31);
}
else if (mass <= 64.47)
{
//radius = quad_trend(-8.815415E-5, 0.0207119427, 2.658103285, mass);
radius1 = planet_radius_helper(mass, 47.15, mass_radii[47.15], 55.31, mass_radii[55.31], 64.47, mass_radii[64.47]);
radius2 = planet_radius_helper(mass, 55.31, mass_radii[55.31], 64.47, mass_radii[64.47], 74.65, mass_radii[74.65]);
radius = rangeAdjust(mass, radius1, radius2, 55.31, 64.47);
}
else if (mass <= 74.65)
{
//radius = quad_trend(-6.854458E-5, 0.0179838587, 2.752478002, mass);
radius1 = planet_radius_helper(mass, 55.31, mass_radii[55.31], 64.47, mass_radii[64.47], 74.65, mass_radii[74.65]);
radius2 = planet_radius_helper(mass, 64.47, mass_radii[64.47], 74.65, mass_radii[74.65], 86.14, mass_radii[86.14]);
radius = rangeAdjust(mass, radius1, radius2, 64.47, 74.65);
}
else if (mass <= 86.14)
{
//radius = quad_trend(-4.142592E-5, 0.0136234496, 2.926860492, mass);
radius1 = planet_radius_helper(mass, 64.47, mass_radii[64.47], 74.65, mass_radii[74.65], 86.14, mass_radii[86.14]);
radius2 = planet_radius_helper(mass, 74.65, mass_radii[74.65], 86.14, mass_radii[86.14], 99.08, mass_radii[99.08]);
radius = rangeAdjust(mass, radius1, radius2, 74.65, 86.14);
}
else if (mass <= 99.08)
{
//radius = quad_trend(-4.113636E-5, 0.0135698167, 2.929331843, mass);
radius1 = planet_radius_helper(mass, 74.65, mass_radii[74.65], 86.14, mass_radii[86.14], 99.08, mass_radii[99.08]);
radius2 = planet_radius_helper(mass, 86.14, mass_radii[86.14], 99.08, mass_radii[99.08], 113.6, mass_radii[113.6]);
radius = rangeAdjust(mass, radius1, radius2, 86.14, 99.08);
}
else if (mass <= 113.6)
{
//radius = quad_trend(-2.356492E-5, 0.0098327232, 3.127106958, mass);
radius1 = planet_radius_helper(mass, 86.14, mass_radii[86.14], 99.08, mass_radii[99.08], 113.6, mass_radii[113.6]);
radius2 = planet_radius_helper(mass, 99.08, mass_radii[99.08], 113.6, mass_radii[113.6], 129.7, mass_radii[129.7]);
radius = rangeAdjust(mass, radius1, radius2, 99.08, 113.6);
}
else if (mass <= 129.7)
{
//radius = quad_trend(-2.526928E-5, 0.010247394, 3.101995053, mass);
radius1 = planet_radius_helper(mass, 99.08, mass_radii[99.08], 113.6, mass_radii[113.6], 129.7, mass_radii[129.7]);
radius2 = planet_radius_helper(mass, 113.6, mass_radii[113.6], 129.7, mass_radii[129.7], 147.6, mass_radii[147.6]);
radius = rangeAdjust(mass, radius1, radius2, 113.6, 129.7);
}
else if (mass <= 147.6)
{
//radius = quad_trend(-1.565766E-5, 0.0075820925, 3.285997163, mass);
radius1 = planet_radius_helper(mass, 113.6, mass_radii[113.6], 129.7, mass_radii[129.7], 147.6, mass_radii[147.6]);
radius2 = planet_radius_helper(mass, 129.7, mass_radii[129.7], 147.6, mass_radii[147.6], 167.2, mass_radii[167.2]);
radius = rangeAdjust(mass, radius1, radius2, 129.7, 147.6);
}
else if (mass <= 167.2)
{
//radius = quad_trend(-1.270465E-5, 0.0066524852, 3.358873654, mass);
radius1 = planet_radius_helper(mass, 129.7, mass_radii[129.7], 147.6, mass_radii[147.6], 167.2, mass_radii[167.2]);
radius2 = planet_radius_helper(mass, 147.6, mass_radii[147.6], 167.2, mass_radii[167.2], 188.8, mass_radii[188.8]);
radius = rangeAdjust(mass, radius1, radius2, 147.6, 167.2);
}
else if (mass <= 188.8)
{
//radius = quad_trend(-9.754214E-6, 0.00560213, 3.452011125, mass);
radius1 = planet_radius_helper(mass, 147.6, mass_radii[147.6], 167.2, mass_radii[167.2], 188.8, mass_radii[188.8]);
radius2 = planet_radius_helper(mass, 167.2, mass_radii[167.2], 188.8, mass_radii[188.8], 212.5, mass_radii[212.5]);
radius = rangeAdjust(mass, radius1, radius2, 167.2, 188.8);
}
else if (mass <= 212.5)
{
//radius = quad_trend(-7.560935E-6, 0.0047219671, 3.540005479, mass);
radius1 = planet_radius_helper(mass, 167.2, mass_radii[167.2], 188.8, mass_radii[188.8], 212.5, mass_radii[212.5]);
radius2 = planet_radius_helper(mass, 188.8, mass_radii[188.8], 212.5, mass_radii[212.5], 238.4, mass_radii[238.4]);
radius = rangeAdjust(mass, radius1, radius2, 188.8, 212.5);
}
else if (mass <= 238.4)
{
//radius = quad_trend(-5.370434E-6, 0.0037342699, 3.650976298, mass);
radius1 = planet_radius_helper(mass, 188.8, mass_radii[188.8], 212.5, mass_radii[212.5], 238.4, mass_radii[238.4]);
radius2 = planet_radius_helper(mass, 212.5, mass_radii[212.5], 238.4, mass_radii[238.4], 266.8, mass_radii[266.8]);
radius = rangeAdjust(mass, radius1, radius2, 212.5, 238.4);
}
else if (mass <= 266.8)
{
//radius = quad_trend(-4.732385E-6, 0.0034229278, 3.69155945, mass);
radius1 = planet_radius_helper(mass, 212.5, mass_radii[212.5], 238.4, mass_radii[238.4], 266.8, mass_radii[266.8]);
radius2 = planet_radius_helper(mass, 238.4, mass_radii[238.4], 266.8, mass_radii[266.8], 297.9, mass_radii[297.9]);
radius = rangeAdjust(mass, radius1, radius2, 238.4, 266.8);
}
else if (mass <= 297.9)
{
//radius = quad_trend(-2.817677E-6, 0.0023306918, 3.843739954, mass);
radius1 = planet_radius_helper(mass, 238.4, mass_radii[238.4], 266.8, mass_radii[266.8], 297.9, mass_radii[297.9]);
radius2 = planet_radius_helper(mass, 266.8, mass_radii[266.8], 297.9, mass_radii[297.9], 332.1, mass_radii[332.1]);
radius = rangeAdjust(mass, radius1, radius2, 266.8, 297.9);
}
else if (mass <= 332.1)
{
radius1 = planet_radius_helper(mass, 266.8, mass_radii[266.8], 297.9, mass_radii[297.9], 332.1, mass_radii[332.1]);
radius2 = planet_radius_helper2(mass, 297.9, mass_radii[297.9], 332.1, mass_radii[332.1]);
radius = rangeAdjust(mass, radius1, radius2, 297.9, 332.1);
}
else
{
//radius = ln_trend(3.292047445, 0.1748279599, mass);
radius = planet_radius_helper2(mass, 297.9, mass_radii[297.9], 332.1, mass_radii[332.1]);
}
if (adjust_for_carbon)
{
carbon_fraction = rmf * cmf;
grow_factor = (0.05 * carbon_fraction) + 1.0; // not very scientific but guested by eye-balling an image on wikipedia.
radius *= grow_factor;
}
if (flag_verbose & 0x80000)
{
radiusDebug("25% rock, 75% water/ice", the_planet, radius, mass_radii);
}
return radius;
}
long double half_rock_half_water_radius(long double mass, long double cmf, planet *the_planet, map<long double, long double> &mass_radii)
{
long double radius;
long double radius1;
long double radius2;
bool adjust_for_carbon;
long double carbon_fraction;
long double grow_factor;
long double rmf;
adjust_for_carbon = true;
rmf = 0.5;
if (mass <= 0.008278)
{
adjust_for_carbon = false;
radius1 = fraction_radius(mass, 0.5, 0.5, cmf);
radius2 = planet_radius_helper(mass, 0.008278, mass_radii[0.008278], 0.01156, mass_radii[0.01156], 0.01615, mass_radii[0.01615]);
radius = rangeAdjust(mass, radius1, radius2, 0.0, 0.008278);
}
else if (mass <= 0.01156)
{
//radius = quad_trend(-251.097088, 14.82282406, 0.1908031617, mass);
radius = planet_radius_helper(mass, 0.008278, mass_radii[0.008278], 0.01156, mass_radii[0.01156], 0.01615, mass_radii[0.01615]);
}
else if (mass <= 0.01615)
{
//radius = quad_trend(-144.1013419, 11.85797193, 0.2107786256, mass);
radius1 = planet_radius_helper(mass, 0.008278, mass_radii[0.008278], 0.01156, mass_radii[0.01156], 0.01615, mass_radii[0.01615]);
radius2 = planet_radius_helper(mass, 0.01156, mass_radii[0.01156], 0.01615, mass_radii[0.01615], 0.02255, mass_radii[0.02255]);
radius = rangeAdjust(mass, radius1, radius2, 0.01156, 0.01615);
}
else if (mass <= 0.02255)
{
//radius = quad_trend(-86.45685997, 9.627130481, 0.2317717371, mass);
radius1 = planet_radius_helper(mass, 0.01156, mass_radii[0.01156], 0.01615, mass_radii[0.01615], 0.02255, mass_radii[0.02255]);
radius2 = planet_radius_helper(mass, 0.01615, mass_radii[0.01615], 0.02255, mass_radii[0.02255], 0.0313, mass_radii[0.0313]);
radius = rangeAdjust(mass, radius1, radius2, 0.01615, 0.02255);
}
else if (mass <= 0.0313)
{
//radius = quad_trend(-52.75830191, 7.812463129, 0.2555566849, mass);
radius1 = planet_radius_helper(mass, 0.01615, mass_radii[0.01615], 0.02255, mass_radii[0.02255], 0.0313, mass_radii[0.0313]);
radius2 = planet_radius_helper(mass, 0.02255, mass_radii[0.02255], 0.0313, mass_radii[0.0313], 0.04314, mass_radii[0.04314]);
radius = rangeAdjust(mass, radius1, radius2, 0.02255, 0.0313);
}
else if (mass <= 0.04314)
{
//radius = quad_trend(-27.9087717, 5.9626641, 0.2891105582, mass);
radius1 = planet_radius_helper(mass, 0.02255, mass_radii[0.02255], 0.0313, mass_radii[0.0313], 0.04314, mass_radii[0.04314]);
radius2 = planet_radius_helper(mass, 0.02255, mass_radii[0.0313], 0.04314, mass_radii[0.04314], 0.05943, mass_radii[0.05943]);
radius = rangeAdjust(mass, radius1, radius2, 0.0313, 0.04314);
}
else if (mass <= 0.05943)
{
//radius = quad_trend(-15.88199788, 4.72907791, 0.3199449236, mass);
radius1 = planet_radius_helper(mass, 0.02255, mass_radii[0.0313], 0.04314, mass_radii[0.04314], 0.05943, mass_radii[0.05943]);
radius2 = planet_radius_helper(mass, 0.04314, mass_radii[0.04314], 0.05943, mass_radii[0.05943], 0.0817, mass_radii[0.0817]);
radius = rangeAdjust(mass, radius1, radius2, 0.04314, 0.05943);
}
else if (mass <= 0.0817)
{
//radius = quad_trend(-9.401792072, 3.814526464, 0.3514091157, mass);
radius1 = planet_radius_helper(mass, 0.04314, mass_radii[0.04314], 0.05943, mass_radii[0.05943], 0.0817, mass_radii[0.0817]);
radius2 = planet_radius_helper(mass, 0.05943, mass_radii[0.05943], 0.0817, mass_radii[0.0817], 0.112, mass_radii[0.112]);
radius = rangeAdjust(mass, radius1, radius2, 0.05943, 0.0817);
}
else if (mass <= 0.112)
{
//radius = quad_trend(-5.4572037, 3.050459697, 0.3875036772, mass);
radius1 = planet_radius_helper(mass, 0.05943, mass_radii[0.05943], 0.0817, mass_radii[0.0817], 0.112, mass_radii[0.112]);
radius2 = planet_radius_helper(mass, 0.0817, mass_radii[0.0817], 0.112, mass_radii[0.112], 0.1528, mass_radii[0.1528]);
radius = rangeAdjust(mass, radius1, radius2, 0.0817, 0.112);
}
else if (mass <= 0.1528)
{
//radius = quad_trend(-3.312524816, 2.482548728, 0.4242068537, mass);
radius1 = planet_radius_helper(mass, 0.0817, mass_radii[0.0817], 0.112, mass_radii[0.112], 0.1528, mass_radii[0.1528]);
radius2 = planet_radius_helper(mass, 0.112, mass_radii[0.112], 0.1528, mass_radii[0.1528], 0.2074, mass_radii[0.2074]);
radius = rangeAdjust(mass, radius1, radius2, 0.112, 0.1528);
}
else if (mass <= 0.2074)
{
//radius = quad_trend(-1.983760111, 2.003927681, 0.466316364, mass);
radius1 = planet_radius_helper(mass, 0.112, mass_radii[0.112], 0.1528, mass_radii[0.1528], 0.2074, mass_radii[0.2074]);
radius2 = planet_radius_helper(mass, 0.1528, mass_radii[0.1528], 0.2074, mass_radii[0.2074], 0.2799, mass_radii[0.2799]);
radius = rangeAdjust(mass, radius1, radius2, 0.1528, 0.2074);
}
else if (mass <= 0.2799)
{
//radius = quad_trend(-1.206466699, 1.625152602, 0.5114392259, mass);
radius1 = planet_radius_helper(mass, 0.1528, mass_radii[0.1528], 0.2074, mass_radii[0.2074], 0.2799, mass_radii[0.2799]);
radius2 = planet_radius_helper(mass, 0.2074, mass_radii[0.2074], 0.2799, mass_radii[0.2799], 0.3754, mass_radii[0.3754]);
radius = rangeAdjust(mass, radius1, radius2, 0.2074, 0.2799);
}
else if (mass <= 0.3754)
{
//radius = quad_trend(-0.7427608407, 1.321286153, 0.5601628686, mass);
radius1 = planet_radius_helper(mass, 0.2074, mass_radii[0.2074], 0.2799, mass_radii[0.2799], 0.3754, mass_radii[0.3754]);
radius2 = planet_radius_helper(mass, 0.2799, mass_radii[0.2799], 0.3754, mass_radii[0.3754], 0.4998, mass_radii[0.4998]);
radius = rangeAdjust(mass, radius1, radius2, 0.2799, 0.3754);
}
else if (mass <= 0.4998)
{
//radius = quad_trend(-0.4356758148, 1.052525338, 0.617779672, mass);
radius1 = planet_radius_helper(mass, 0.2799, mass_radii[0.2799], 0.3754, mass_radii[0.3754], 0.4998, mass_radii[0.4998]);
radius2 = planet_radius_helper(mass, 0.3754, mass_radii[0.3754], 0.4998, mass_radii[0.4998], 0.6607, mass_radii[0.6607]);
radius = rangeAdjust(mass, radius1, radius2, 0.3754, 0.4998);
}
else if (mass <= 0.6607)
{
//radius = quad_trend(-0.279489115, 0.8712706729, 0.6693553098, mass);
radius1 = planet_radius_helper(mass, 0.3754, mass_radii[0.3754], 0.4998, mass_radii[0.4998], 0.6607, mass_radii[0.6607]);
radius2 = planet_radius_helper(mass, 0.4998, mass_radii[0.4998], 0.6607, mass_radii[0.6607], 0.8653, mass_radii[0.8653]);
radius = rangeAdjust(mass, radius1, radius2, 0.4998, 0.6607);
}
else if (mass <= 0.8653)
{
//radius = quad_trend(-0.1823992238, 0.7231114989, 0.7248619608, mass);
radius1 = planet_radius_helper(mass, 0.4998, mass_radii[0.4998], 0.6607, mass_radii[0.6607], 0.8653, mass_radii[0.8653]);
radius2 = planet_radius_helper(mass, 0.6607, mass_radii[0.6607], 0.8653, mass_radii[0.8653], 1.117, mass_radii[1.117]);
radius = rangeAdjust(mass, radius1, radius2, 0.6607, 0.8653);
}
else if (mass <= 1.117)
{
//radius = quad_trend(-0.1131126774, 0.5857647781, 0.7918301862, mass);
radius1 = planet_radius_helper(mass, 0.6607, mass_radii[0.6607], 0.8653, mass_radii[0.8653], 1.117, mass_radii[1.117]);
radius2 = planet_radius_helper(mass, 0.8653, mass_radii[0.8653], 1.117, mass_radii[1.117], 1.437, mass_radii[1.437]);
radius = rangeAdjust(mass, radius1, radius2, 0.8653, 1.117);
}
else if (mass <= 1.437)
{
//radius = quad_trend(-0.0723180077, 0.4815751916, 0.8573108937, mass);
radius1 = planet_radius_helper(mass, 0.8653, mass_radii[0.8653], 1.117, mass_radii[1.117], 1.437, mass_radii[1.437]);
radius2 = planet_radius_helper(mass, 1.117, mass_radii[1.117], 1.437, mass_radii[1.437], 1.842, mass_radii[1.842]);
radius = rangeAdjust(mass, radius1, radius2, 1.117, 1.437);
}
else if (mass <= 1.842)
{
//radius = quad_trend(-0.0460469153, 0.3954322797, 0.9268492667, mass);
radius1 = planet_radius_helper(mass, 1.117, mass_radii[1.117], 1.437, mass_radii[1.437], 1.842, mass_radii[1.842]);
radius2 = planet_radius_helper(mass, 1.437, mass_radii[1.437], 1.842, mass_radii[1.842], 2.351, mass_radii[2.351]);
radius = rangeAdjust(mass, radius1, radius2, 1.437, 1.842);
}
else if (mass <= 2.351)
{
//radius = quad_trend(-0.0313721992, 0.3339011952, 0.990398741, mass);
radius1 = planet_radius_helper(mass, 1.437, mass_radii[1.437], 1.842, mass_radii[1.842], 2.351, mass_radii[2.351]);
radius2 = planet_radius_helper(mass, 1.842, mass_radii[1.842], 2.351, mass_radii[2.351], 2.988, mass_radii[2.988]);
radius = rangeAdjust(mass, radius1, radius2, 1.842, 2.351);
}
else if (mass <= 2.988)
{
//radius = quad_trend(-0.0192555176, 0.269210232, 1.075515861, mass);
radius1 = planet_radius_helper(mass, 1.842, mass_radii[1.842], 2.351, mass_radii[2.351], 2.988, mass_radii[2.988]);
radius2 = planet_radius_helper(mass, 2.351, mass_radii[2.351], 2.988, mass_radii[2.988], 3.78, mass_radii[3.78]);
radius = rangeAdjust(mass, radius1, radius2, 2.351, 2.988);
}
else if (mass <= 3.78)
{
//radius = quad_trend(-0.0123380727, 0.2223929652, 1.15364591, mass);
radius1 = planet_radius_helper(mass, 2.351, mass_radii[2.351], 2.988, mass_radii[2.988], 3.78, mass_radii[3.78]);
radius2 = planet_radius_helper(mass, 2.988, mass_radii[2.988], 3.78, mass_radii[3.78], 4.763, mass_radii[4.763]);
radius = rangeAdjust(mass, radius1, radius2, 2.988, 3.78);
}
else if (mass <= 4.763)
{
//radius = quad_trend(-0.0092219964, 0.1957723254, 1.209748184, mass);
radius1 = planet_radius_helper(mass, 2.988, mass_radii[2.988], 3.78, mass_radii[3.78], 4.763, mass_radii[4.763]);
radius2 = planet_radius_helper(mass, 3.78, mass_radii[3.78], 4.763, mass_radii[4.763], 5.972, mass_radii[5.972]);
radius = rangeAdjust(mass, radius1, radius2, 3.78, 4.763);
}
else if (mass <= 5.972)
{
//radius = quad_trend(-0.006005431, 0.1612424952, 1.301242218, mass);
radius1 = planet_radius_helper(mass, 3.78, mass_radii[3.78], 4.763, mass_radii[4.763], 5.972, mass_radii[5.972]);
radius2 = planet_radius_helper(mass, 4.763, mass_radii[4.763], 5.972, mass_radii[5.972], 7.392, mass_radii[7.392]);
radius = rangeAdjust(mass, radius1, radius2, 4.763, 5.972);
}
else if (mass <= 7.392)
{
//radius = quad_trend(-0.0046758803, 0.1434743798, 1.359935265, mass);
radius1 = planet_radius_helper(mass, 4.763, mass_radii[4.763], 5.972, mass_radii[5.972], 7.392, mass_radii[7.392]);
radius2 = planet_radius_helper(mass, 5.972, mass_radii[5.972], 7.392, mass_radii[7.392], 9.043, mass_radii[9.043]);
radius = rangeAdjust(mass, radius1, radius2, 5.972, 7.392);
}
else if (mass <= 9.043)
{
//radius = quad_trend(-0.0029585423, 0.1152499298, 1.474732193, mass);
radius1 = planet_radius_helper(mass, 5.972, mass_radii[5.972], 7.392, mass_radii[7.392], 9.043, mass_radii[9.043]);
radius2 = planet_radius_helper(mass, 7.392, mass_radii[7.392], 9.043, mass_radii[9.043], 11.03, mass_radii[11.03]);
radius = rangeAdjust(mass, radius1, radius2, 7.392, 9.043);
}
else if (mass <= 11.03)
{
//radius = quad_trend(-0.0019751495, 0.0955102856, 1.572820013, mass);
radius1 = planet_radius_helper(mass, 7.392, mass_radii[7.392], 9.043, mass_radii[9.043], 11.03, mass_radii[11.03]);
radius2 = planet_radius_helper(mass, 9.043, mass_radii[9.043], 11.03, mass_radii[11.03], 13.4, mass_radii[13.4]);
radius = rangeAdjust(mass, radius1, radius2, 9.043, 11.03);
}
else if (mass <= 13.4)
{
//radius = quad_trend(-0.0014930172, 0.0837317945, 1.644080125, mass);
radius1 = planet_radius_helper(mass, 9.043, mass_radii[9.043], 11.03, mass_radii[11.03], 13.4, mass_radii[13.4]);
radius2 = planet_radius_helper(mass, 11.03, mass_radii[11.03], 13.4, mass_radii[13.4], 16.18, mass_radii[16.18]);
radius = rangeAdjust(mass, radius1, radius2, 11.03, 13.4);
}
else if (mass <= 16.18)
{
//radius = quad_trend(-0.0010753359, 0.0713767814, 1.734638445, mass);
radius1 = planet_radius_helper(mass, 11.03, mass_radii[11.03], 13.4, mass_radii[13.4], 16.18, mass_radii[16.18]);
radius2 = planet_radius_helper(mass, 13.4, mass_radii[13.4], 16.18, mass_radii[16.18], 19.48, mass_radii[19.48]);
radius = rangeAdjust(mass, radius1, radius2, 13.4, 16.18);
}
else if (mass <= 19.48)
{
//radius = quad_trend(-7.235726E-4, 0.058832903, 1.845509445, mass);
radius1 = planet_radius_helper(mass, 13.4, mass_radii[13.4], 16.18, mass_radii[16.18], 19.48, mass_radii[19.48]);
radius2 = planet_radius_helper(mass, 16.18, mass_radii[16.18], 19.48, mass_radii[19.48], 23.36, mass_radii[23.36]);
radius = rangeAdjust(mass, radius1, radius2, 16.18, 19.48);
}
else if (mass <= 23.36)
{
//radius = quad_trend(-5.028683E-4, 0.049377928, 1.945941584, mass);
radius1 = planet_radius_helper(mass, 16.18, mass_radii[16.18], 19.48, mass_radii[19.48], 23.36, mass_radii[23.36]);
radius2 = planet_radius_helper(mass, 19.48, mass_radii[19.48], 23.36, mass_radii[23.36], 27.94, mass_radii[27.94]);
radius = rangeAdjust(mass, radius1, radius2, 19.48, 23.36);
}
else if (mass <= 27.94)
{
//radius = quad_trend(-4.006219E-4, 0.0441326902, 2.012675568, mass);
radius1 = planet_radius_helper(mass, 19.48, mass_radii[19.48], 23.36, mass_radii[23.36], 27.94, mass_radii[27.94]);
radius2 = planet_radius_helper(mass, 23.36, mass_radii[23.36], 27.94, mass_radii[27.94], 33.24, mass_radii[33.24]);
radius = rangeAdjust(mass, radius1, radius2, 23.36, 27.94);
}
else if (mass <= 33.24)
{
//radius = quad_trend(-2.667319E-4, 0.0359413008, 2.137022627, mass);
radius1 = planet_radius_helper(mass, 23.36, mass_radii[23.36], 27.94, mass_radii[27.94], 33.24, mass_radii[33.24]);
radius2 = planet_radius_helper(mass, 27.94, mass_radii[27.94], 33.24, mass_radii[33.24], 39.33, mass_radii[39.33]);
radius = rangeAdjust(mass, radius1, radius2, 27.94, 33.24);
}
else if (mass <= 39.33)
{
//radius = quad_trend(-2.098119E-4, 0.0318106148, 2.211435834, mass);
radius1 = planet_radius_helper(mass, 27.94, mass_radii[27.94], 33.24, mass_radii[33.24], 39.33, mass_radii[39.33]);
radius2 = planet_radius_helper(mass, 33.24, mass_radii[33.24], 39.33, mass_radii[39.33], 46.26, mass_radii[46.26]);
radius = rangeAdjust(mass, radius1, radius2, 33.24, 39.33);
}
else if (mass <= 46.26)
{
//radius = quad_trend(-1.493274E-4, 0.0266337427, 2.321481765, mass);
radius1 = planet_radius_helper(mass, 33.24, mass_radii[33.24], 39.33, mass_radii[39.33], 46.26, mass_radii[46.26]);
radius2 = planet_radius_helper(mass, 39.33, mass_radii[39.33], 46.26, mass_radii[46.26], 54.07, mass_radii[54.07]);
radius = rangeAdjust(mass, radius1, radius2, 39.33, 49.26);
}
else if (mass <= 54.07)
{
//radius = quad_trend(-1.209301E-4, 0.0237846466, 2.392511186, mass);
radius1 = planet_radius_helper(mass, 39.33, mass_radii[39.33], 46.26, mass_radii[46.26], 54.07, mass_radii[54.07]);
radius2 = planet_radius_helper(mass, 46.26, mass_radii[46.26], 54.07, mass_radii[54.07], 62.77, mass_radii[62.77]);
radius = rangeAdjust(mass, radius1, radius2, 49.26, 54.07);
}
else if (mass <= 62.77)