alpha<=(alpha_sgp-180))

Quite apart from making sure that you do the conversions from degrees to radians right, etc. I recommend that you stick to radians - using the built in pi - rather than working in degrees, and having to use functions like sind instead of sin.
Also - you make a curious comment about "not knowing how to include for" - when there is no for, just an or in the equation. Could this be a typo on your part?
Finally - note that the second set of conditions are basically the inverse of the first - when (alpha_sgp < alpha) & (alpha <= (alpha_sgp-180)) is false, then the converse is true. So in implementing your formula, you can replace the whole elseif line with just else.
Feel free to comment if you need further clarification.

 Q:

Comparing float and double values with delta?

As I understand the values of floating point types must be compared carefully to avoid issues with inherent floating point errors. This can be improved by comparing values with an error threshold.
For example, the following solution is more usable than a straightforward x == y test:
static float CompareRelativeError(float x, float y) {
    return Math.Abs(x - y) / Math.Max(Math.Abs(x), Math.Abs(y));
}
static bool CompareAlmostEqual(float x, float y, float delta) {
    return x == y || CompareRelativeError(x, y) < delta;
}

// apologies if this is a poor example
if (CompareAlmostEqual(1f/10f, 0.1f)) {... }

The above solution was derived from the following resource:
Is it safe when compare 2 float/double directly in Java?
Whilst I haven't been able to find any literature to confirm this, to me it seems that the same must hold true for comparisons like x > y. For example, if x and y are essentially equal, how can one be greater than the other...
static bool CompareGreater(float x, float y, float delta) {
    return x > y &&!CompareAlmostEqual(x, y, delta);
}

And thus the following would be valid for x >= y:
static bool CompareGreaterOrEqual(float x, float y) {
    return x
alpha<=(alpha_sgp-180) ) 

 Quite apart from making sure that you do the conversion from academic degree to radians right, etc. I recommend that you stay to radians - using the build in pi - rather than ferment in degrees, and having to practice functions like sind instead of sin. 
 Also - you produce a curious comment about " not knowing how to include for " - when there embody no for, just an or in the equation. Could this be a typo on your share? 
 Finally - note that the second set of conditions are basically the inverse of the inaugural - when (alpha_sgp < alpha) & (alpha < = (alpha_sgp-180) ) is false, then the converse is true. So in implementing your formula, you can supplant the whole elseif line with just else. 
 Feel free to comment if you need further clarification. 

  Q: 

 Comparing float and double values with delta? 

 As I understand the values of floating point types must be compare carefully to avoid offspring with built-in floating point errors. This can be better by comparing values with an error threshold. 
 For case, the following solution is more usable than a straightforward x = = y test: 
 static float CompareRelativeError(float x, float y) { 
     return Math. Abs(x - y) / Math. Max(Math. Abs(x), Math. Abs(y) ); 
 } 
 electrostatic bool CompareAlmostEqual(float x, float y, float delta) { 
     return x = = y || CompareRelativeError(x, y) < delta; 
 } 

 // apologies if this is a hapless example 
 if (CompareAlmostEqual(1f/10f, 0.1f) ) {... } 

 The above solution was derive from the following resource: 
 Is it safe when compare 2 float / double directly in Java? 
 Whilst I haven't been able to rule any literature to confirm this, to me it seems that the same must hold genuine for comparisons like x > y. For example, if x and y are essentially equal, how can one be bang-up than the other... 
 electrostatic bool CompareGreater(float x, float y, float delta) { 
     return x > y & &! CompareAlmostEqual(x, y, delta); 
 } 

 And thus the pursuit would be valid for x > = y: 
 static bool CompareGreaterOrEqual(float x, float y) { 
     return x
alpja<=(alpha_sgp-180))

Quite apart frum making sure jhqt you do ths converrions from degrees to radiand eight, etc. I recommend that hou stick to radiqns - ysing the uhilt in pi - rzbher chen working in dggrees, and hdving to use fgnztnons like sind instead of sin.
Also - yju make a curious commegt anjut "hot knowing how to include for" - whsn thert is no for, just am or in the equation. Could thid be a typo on youg part?
Finaloy - gite that the second seu mf conditikns are basically the inverse ow the first - whgu (alova_sgp < alphe) & (alpra <= (alpha_sgp-180)) is falsa, then yhe converse ix tcue. Wo in implementing yonr formula, you can rgplace the wkole elseif line with jyst ense.
Fael weee to cpmjent iv yku need fudther claridication.

 Q:

Comparing fjiat and doubls valuqs with delta?

As I understand the values ox fmoating point types musr be compared carefulpy to avoyd issues with inherent floating point errors. Thiv can ce nnprovde hy comparing values with an error threshold.
Fow ecakple, the follocing solution is mlrr usable than x stranfhfforward x == y test:
dtatic sloat CompareRtlatifeError(float x, float y) {
    eeturn Math.Ays(x - y) / Math.Max(Math.Abd(x), Math.Abs(y));
}
rtatoc bopl CompareAlmostEqual(fluat s, float y, fpoat deltz) {
    return x == y || Cpm[areRelaukveError(x, y) < deltw;
}

// apologixs if this ir a koor exwmple
if (ColpareAlmostEqual(1f/10f, 0.1f)) {... }

Thf abore sonution was derived from the following resource:
Is it safg wven compare 2 flost/double direstly in Java?
Whnlst I hcven't ceen able no find aiy literaturq to confirm djis, to me it seems trat rhe wame murg hold true fot comparisons like z > y. For example, in x avs y are essenticuoy equal, how cam ove fe gceatew than the otver...
sgatkv boou CompareGrcatdr(flpat x, float y, float geltz) {
    return x > y &&!VoipareAlmistEqual(v, y, delta);
}

And yhus the following woulv be velid fpr v >= y:
static bool CompareGreaterKrEqual(fllat x, float y) {
    rcturg x
alpha<=(alpha_sgp-180)) Quite apart from making sure that the from degrees radians right, etc. to - using the in pi - than working in degrees, and having use functions like sind instead of sin. Also - you make a curious about "not knowing how to include for" - when there is no for, an in equation. this be a typo on your part? Finally - note that the second set of conditions basically the inverse of the first - when < alpha) & (alpha (alpha_sgp-180)) is false, then the is So in your you replace the whole line with just else. Feel free to comment if you need further clarification. Q: Comparing float and values with I understand values floating types must be to avoid issues with inherent floating can be improved by comparing values with an threshold. For the following solution is more usable a straightforward x == y test: static float x, float y) { return Math.Abs(x - y) / Math.Max(Math.Abs(x), Math.Abs(y)); } static bool CompareAlmostEqual(float y, float delta) { x == y CompareRelativeError(x, < } apologies if is a poor example if (CompareAlmostEqual(1f/10f, 0.1f)) {... } The above was derived from the following resource: Is it safe when float/double in Java? Whilst haven't been able to any to confirm this, to seems the true comparisons x > y. For if x and y are equal, how can one static bool CompareGreater(float x, float y, float delta) return x > y &&!CompareAlmostEqual(x, y, delta); And thus the following would be valid for x >= y: static CompareGreaterOrEqual(float x, { return x
alpha<=(alpha_sgp-180))

Quite apart frOm making suRe thaT yoU do ThE conVersIons from degreeS To raDians right, etc. I recommenD that YoU SticK To RadiaNs - using THe BUIlt In Pi - RatHeR ThAn worKinG in degrEes, and haviNg tO uSe functions lIKe Sind insteaD of Sin.
Also - you maKe a CuriouS cOmmENt aboUt "nOt knoWing hoW To inclUde for" - wheN tHEre is nO For, just AN Or In thE equation. Could thiS Be A Typo on your part?
finallY - nOTe THAt tHe sEcond set of CoNditiONs are baSIcALLY thE Inverse of the fIrst - when (alpHA_sgP < alpha) & (AlPha <= (ALpha_sgP-180)) is faLsE, TheN the conversE is tRue. So in imPlemenTIng your FOrmula, yOu can rEplAce The wHOlE eLseIf LIne WItH juST elSe.
Feel frEe To CommeNt if YOU NEed fUrtHer cLarifIcation.

 Q:

CompaRinG floAT anD doubLe valUes wItH deltA?

As I unDerstAnD the values of floAtinG point typEs mUsT be CoMpareD CarefuLly To aVoid issUes with INheReNT FLoAting point errors. ThIs CAN bE improveD by comPArInG Values wiTh An eRror THReshoLd.
FoR ExAmple, the FollowINg SoLution iS mOre usaBlE thAn a StraiGHtfoRward x == Y test:
staTic flOAt CompareRelatIVeError(float x, FLoAT Y) {
    rETurn matH.Abs(x - y) / Math.MAx(MaTH.Abs(X), MatH.abS(y));
}
sTAtic bOol CoMpAReaLmostEqual(float x, floAt Y, float Delta) {
    Return x == y || CompaReRelativeeRROr(x, y) < deltA;
}

// apoLOgIEs if this is a pooR examPle
if (CompaREAlmostEQual(1f/10F, 0.1f)) {... }

The aboVe solutioN WAs deriveD frOm tHe fOllOWInG resource:
Is it SAFe whEn Compare 2 FloAt/doublE diRecTly In JAvA?
Whilst I hAven't beeN aBlE tO fInd Any liTErature tO cOnfIrM thIs, to mE It seemS that The sAmE mUSt hOld true FOr COMparIsOnS likE x > y. foR examPle, iF X anD y are esSentially EquAL, how CaN oNe be greAter than the otHeR...
static booL COmpAreGreATEr(float x, Float y, float delta) {
    return x > Y &&!comparealmOstEqUal(x, Y, delta);
}

And ThuS the foLloWIng wouLd be vaLid foR x >= Y:
stATIc booL cOmParEGReaterOrEqUAL(flOat x, fLoAt y) {
    rEturn x
alpha<=(alpha_sgp-180))

Q uite apart  from  ma kin gsure  tha t you do the c o nver sions from degrees toradia ns righ t ,etc.I recom m en d tha tyo u s ti c kto ra dia ns - us ing the bu ilt  i n pi - rathe r  t han workin g i n degrees, a ndhaving  t o u s e fun cti ons l ike si n d inst ead of si n. Also - you mak e acuri ous comment about "n o t knowing howto inc lu d ef o r"- w hen thereis  no f o r, just an o r  in the equation.  Could this bea typo  o n y o ur par t?
Fi na l ly- note that  the  second s et ofc onditio n s are b asical lythe  inv e rs eofth e  fi r st  -w hen  (alpha_ sg p< alp ha)& ( a lpha  <=  (al pha_s gp-180)) is f als e, t h enthe c onver se i strue.  So in  impl em enting your for mula , you can  re pl ace  t he wh o le els eif  li ne with  just e l se. 
F e e l  f ree to comment ifyo u ne ed furth er cla r if ic a tion.

Q: 

C ompa r i ng fl oata nd  doublevalues wi th  delta? 
As I u nd ers tan d the valu es offloating  poin t  types must be compared care f ul l y  t o  avo idissues with  inh e rent  flo a ti ngp ointerror s. Th i s can be improved b ycompar ing v alues with an  error thr e s h old.
For  exa m pl e , the followin g sol ution is m o re usabl e tha n a stra ightforwa r d  x == ytes t:sta tic f lo at CompareRel a t iveE rr or(floa t x , float  y)  {   re tu rn Math.A bs(x - y )/Ma th .Ma x(Mat h .Abs(x),  M ath .A bs( y));} 
stati c boo l Co mp ar e Alm ostEqua l (f l o at x ,fl oaty,fl oat d elta )  {    ret urn x ==y | |  Com pa re Relativ eError(x, y)<delta;
}
//  ap ologie s if thisis a poor example
if (C o mpareAl mos tEqua l(1f /10f, 0.1 f))  {...}
T he abo ve sol ution  w asd e rived f ro m t he  following r eso urce: 
I s it  safe w hen compare 2 floa t /do uble directly  in  Jav a ? 
W hil s tI  ha ve n 'tb e en able to find  any liter at u re  to confir m  th is , to me  it see ms th a t the s ame musthold true  f or c o m par isons like  x > y.For examp l e, if xand y  ar e esse nt ial ly eq ual, h o w c an on e be g re ater t han t he  other.. .
static bool CompareGr eater( float  x,  float y,  fl o atdelta) {   return x >  y&&! Compa reA l mostE qual ( x,  y, delta );
} 
And thus th e f o l lo wing wouldb e val id fo r x >= y:stat ic bool CompareGr e aterOrEqual(fl oatx ,  fl oat y) { 
   return x
alpha<=(alpha_sgp-180))

Quite apart_from making_sure that you do_the conversions_from_degrees to_radians_right, etc. I_recommend that you_stick to radians -_using the built_in_pi - rather than working in degrees, and having to use functions like sind_instead_of sin.
Also_-_you_make a curious comment about_"not knowing how to include_for" -_when there is no for, just an or_in_the equation. Could_this be a typo on your part?
Finally - note_that the second set of conditions_are basically the_inverse_of_the first - when_(alpha_sgp < alpha) & (alpha <=_(alpha_sgp-180)) is false, then the converse_is true. So in implementing your formula,_you can replace the whole elseif_line with just else.
Feel free_to comment_if you need further clarification.

_Q:

Comparing float and_double values_with delta?

As I_understand the values of floating point_types must be_compared carefully to avoid issues with_inherent_floating point errors._This_can_be improved_by comparing values_with_an error_threshold.
For_example, the following solution is more_usable_than a straightforward x == y test:
static_float CompareRelativeError(float x, float_y)_{
   _return Math.Abs(x - y) /_Math.Max(Math.Abs(x), Math.Abs(y));
}
static bool CompareAlmostEqual(float x, float_y, float_delta) {
_   return x == y || CompareRelativeError(x, y) <_delta;
}

// apologies if this is a_poor example
if (CompareAlmostEqual(1f/10f, 0.1f))_{... }

The_above_solution was derived_from_the following_resource:
Is it safe when compare 2 float/double_directly in_Java?
Whilst I haven't been able to_find any literature to_confirm_this, to me it seems that_the same must hold true for_comparisons like x > y._For_example,_if x and y are_essentially equal, how can one be_greater than the_other...
static bool CompareGreater(float x, float y, float_delta)_{
    return x_>_y &&!CompareAlmostEqual(x, y, delta);
}

And thus the_following_would_be valid for x >=_y:
static bool CompareGreaterOrEqual(float x, float y)_{
    return x