getStarcast function

double getStarcast(
  1. double x,
  2. double z,
  3. double r,
  4. double checks,
  5. NoisePlane n,
)

Implementation

double getStarcast(double x, double z, double r, double checks, NoisePlane n){
  if(checks >= 1 && checks <= 128){
    if(checks < 2){return sc1(x,z,r,n);}
    if(checks < 3){return sc2(x,z,r,n);}
    if(checks < 4){return sc3(x,z,r,n);}
    if(checks < 5){return sc4(x,z,r,n);}
    if(checks < 6){return sc5(x,z,r,n);}
    if(checks < 7){return sc6(x,z,r,n);}
    if(checks < 8){return sc7(x,z,r,n);}
    if(checks < 9){return sc8(x,z,r,n);}
    if(checks < 10){return sc9(x,z,r,n);}
    if(checks < 11){return sc10(x,z,r,n);}
    if(checks < 12){return sc11(x,z,r,n);}
    if(checks < 13){return sc12(x,z,r,n);}
    if(checks < 14){return sc13(x,z,r,n);}
    if(checks < 15){return sc14(x,z,r,n);}
    if(checks < 16){return sc15(x,z,r,n);}
    if(checks < 17){return sc16(x,z,r,n);}
    if(checks < 18){return sc17(x,z,r,n);}
    if(checks < 19){return sc18(x,z,r,n);}
    if(checks < 20){return sc19(x,z,r,n);}
    if(checks < 21){return sc20(x,z,r,n);}
    if(checks < 22){return sc21(x,z,r,n);}
    if(checks < 23){return sc22(x,z,r,n);}
    if(checks < 24){return sc23(x,z,r,n);}
    if(checks < 25){return sc24(x,z,r,n);}
    if(checks < 26){return sc25(x,z,r,n);}
    if(checks < 27){return sc26(x,z,r,n);}
    if(checks < 28){return sc27(x,z,r,n);}
    if(checks < 29){return sc28(x,z,r,n);}
    if(checks < 30){return sc29(x,z,r,n);}
    if(checks < 31){return sc30(x,z,r,n);}
    if(checks < 32){return sc31(x,z,r,n);}
    if(checks < 33){return sc32(x,z,r,n);}
    if(checks < 34){return sc33(x,z,r,n);}
    if(checks < 35){return sc34(x,z,r,n);}
    if(checks < 36){return sc35(x,z,r,n);}
    if(checks < 37){return sc36(x,z,r,n);}
    if(checks < 38){return sc37(x,z,r,n);}
    if(checks < 39){return sc38(x,z,r,n);}
    if(checks < 40){return sc39(x,z,r,n);}
    if(checks < 41){return sc40(x,z,r,n);}
    if(checks < 42){return sc41(x,z,r,n);}
    if(checks < 43){return sc42(x,z,r,n);}
    if(checks < 44){return sc43(x,z,r,n);}
    if(checks < 45){return sc44(x,z,r,n);}
    if(checks < 46){return sc45(x,z,r,n);}
    if(checks < 47){return sc46(x,z,r,n);}
    if(checks < 48){return sc47(x,z,r,n);}
    if(checks < 49){return sc48(x,z,r,n);}
    if(checks < 50){return sc49(x,z,r,n);}
    if(checks < 51){return sc50(x,z,r,n);}
    if(checks < 52){return sc51(x,z,r,n);}
    if(checks < 53){return sc52(x,z,r,n);}
    if(checks < 54){return sc53(x,z,r,n);}
    if(checks < 55){return sc54(x,z,r,n);}
    if(checks < 56){return sc55(x,z,r,n);}
    if(checks < 57){return sc56(x,z,r,n);}
    if(checks < 58){return sc57(x,z,r,n);}
    if(checks < 59){return sc58(x,z,r,n);}
    if(checks < 60){return sc59(x,z,r,n);}
    if(checks < 61){return sc60(x,z,r,n);}
    if(checks < 62){return sc61(x,z,r,n);}
    if(checks < 63){return sc62(x,z,r,n);}
    if(checks < 64){return sc63(x,z,r,n);}
    if(checks < 65){return sc64(x,z,r,n);}
    if(checks < 66){return sc65(x,z,r,n);}
    if(checks < 67){return sc66(x,z,r,n);}
    if(checks < 68){return sc67(x,z,r,n);}
    if(checks < 69){return sc68(x,z,r,n);}
    if(checks < 70){return sc69(x,z,r,n);}
    if(checks < 71){return sc70(x,z,r,n);}
    if(checks < 72){return sc71(x,z,r,n);}
    if(checks < 73){return sc72(x,z,r,n);}
    if(checks < 74){return sc73(x,z,r,n);}
    if(checks < 75){return sc74(x,z,r,n);}
    if(checks < 76){return sc75(x,z,r,n);}
    if(checks < 77){return sc76(x,z,r,n);}
    if(checks < 78){return sc77(x,z,r,n);}
    if(checks < 79){return sc78(x,z,r,n);}
    if(checks < 80){return sc79(x,z,r,n);}
    if(checks < 81){return sc80(x,z,r,n);}
    if(checks < 82){return sc81(x,z,r,n);}
    if(checks < 83){return sc82(x,z,r,n);}
    if(checks < 84){return sc83(x,z,r,n);}
    if(checks < 85){return sc84(x,z,r,n);}
    if(checks < 86){return sc85(x,z,r,n);}
    if(checks < 87){return sc86(x,z,r,n);}
    if(checks < 88){return sc87(x,z,r,n);}
    if(checks < 89){return sc88(x,z,r,n);}
    if(checks < 90){return sc89(x,z,r,n);}
    if(checks < 91){return sc90(x,z,r,n);}
    if(checks < 92){return sc91(x,z,r,n);}
    if(checks < 93){return sc92(x,z,r,n);}
    if(checks < 94){return sc93(x,z,r,n);}
    if(checks < 95){return sc94(x,z,r,n);}
    if(checks < 96){return sc95(x,z,r,n);}
    if(checks < 97){return sc96(x,z,r,n);}
    if(checks < 98){return sc97(x,z,r,n);}
    if(checks < 99){return sc98(x,z,r,n);}
    if(checks < 100){return sc99(x,z,r,n);}
    if(checks < 101){return sc100(x,z,r,n);}
    if(checks < 102){return sc101(x,z,r,n);}
    if(checks < 103){return sc102(x,z,r,n);}
    if(checks < 104){return sc103(x,z,r,n);}
    if(checks < 105){return sc104(x,z,r,n);}
    if(checks < 106){return sc105(x,z,r,n);}
    if(checks < 107){return sc106(x,z,r,n);}
    if(checks < 108){return sc107(x,z,r,n);}
    if(checks < 109){return sc108(x,z,r,n);}
    if(checks < 110){return sc109(x,z,r,n);}
    if(checks < 111){return sc110(x,z,r,n);}
    if(checks < 112){return sc111(x,z,r,n);}
    if(checks < 113){return sc112(x,z,r,n);}
    if(checks < 114){return sc113(x,z,r,n);}
    if(checks < 115){return sc114(x,z,r,n);}
    if(checks < 116){return sc115(x,z,r,n);}
    if(checks < 117){return sc116(x,z,r,n);}
    if(checks < 118){return sc117(x,z,r,n);}
    if(checks < 119){return sc118(x,z,r,n);}
    if(checks < 120){return sc119(x,z,r,n);}
    if(checks < 121){return sc120(x,z,r,n);}
    if(checks < 122){return sc121(x,z,r,n);}
    if(checks < 123){return sc122(x,z,r,n);}
    if(checks < 124){return sc123(x,z,r,n);}
    if(checks < 125){return sc124(x,z,r,n);}
    if(checks < 126){return sc125(x,z,r,n);}
    if(checks < 127){return sc126(x,z,r,n);}
    if(checks < 128){return sc127(x,z,r,n);}
    return sc128(x,z,r,n);
  }

  double m = 360.0 / checks.toDouble();
  double v = 0;

  for(double i = 0; i < 360; i += m) {
    double sin = math.sin(i * (math.pi / 180.0)).toDouble();
    double cos = math.cos(i * (math.pi / 180.0)).toDouble();
    double cx = x + ((r * cos) - (r * sin));
    double cz = z + ((r * sin) + (r * cos));
    v += n.noise2(cx, cz);
  }

  return v / checks;
}