Skip to content

Commit

Permalink
replace unnecessary cosd, sind calcs
Browse files Browse the repository at this point in the history
  • Loading branch information
satoshi-pes committed Aug 21, 2022
1 parent dab7b20 commit 0905113
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions disp.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,16 @@ func fcTensile(a, xi, eta, z, dip, q float64, v okadaVars) (f1, f2, f3 float64)
func I1(xi, eta, dip, q float64, v okadaVars) float64 {
R := v.R
dt := v.Dt
cosd, sind := v.Cosd, v.Sind

return -xi/(R+dt)*math.Cos(dip) - I4(xi, eta, dip, q, v)*math.Sin(dip)
return -xi/(R+dt)*cosd - I4(xi, eta, dip, q, v)*sind
}

func I2(xi, eta, dip, q float64, v okadaVars) float64 {
R := v.R
dt := v.Dt
return math.Log(R+dt) + I3(xi, eta, dip, q, v)*math.Sin(dip)
sind := v.Sind
return math.Log(R+dt) + I3(xi, eta, dip, q, v)*sind
}

func I3(xi, eta, dip, q float64, v okadaVars) float64 {
Expand Down

0 comments on commit 0905113

Please sign in to comment.