Skip to content

Commit

Permalink
fix error in ua and ub in conical config
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenMulkers committed Oct 11, 2018
1 parent 29a6475 commit 3074ef5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions engine/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ func TwoDomain(mx1, my1, mz1, mxwall, mywall, mzwall, mx2, my2, mz2 float64) Con
func Conical(q, coneDirection data.Vector, coneAngle float64) Config {
u := coneDirection.Div(coneDirection.Len())
// two unit vectors perpendicular to each other and to the cone direction u
ua := data.Vector{u[X] * u[Z], u[Y] * u[Z], -1}.Div(1 - u[Z]*u[Z])
ub := data.Vector{-u[Y], u[X], 0}.Div(1 - u[Z]*u[Z])
p := math.Sqrt(1 - u[Z]*u[Z])
ua := data.Vector{u[X] * u[Z], u[Y] * u[Z], 1 - u[Z]*u[Z]}.Div(p)
ub := data.Vector{-u[Y], u[X], 0}.Div(p)
// cone direction along z direction? -> oops devided by zero, let's fix this
if u[Z]*u[Z] == 1 {
ua = data.Vector{1, 0, 0}
Expand Down

0 comments on commit 3074ef5

Please sign in to comment.