Maths.normalizeVector(n); if (Maths.innerProduct(n, c) < 0) { n.x = -n.x; lg.sensorPos.y - lg.centrePoint.y, lg.sensorPos.z - lg.centrePoint.z); Maths.normalizeVector(s); Maths.normalizeVector(m); final double mnInnerProduct = Maths.innerProduct(m, n); final PosVector n1 = new PosVector(n.x - m.x * mnInnerProduct, n.y - m.y * mnInnerProduct, n.z - m.z * mnInnerProduct); Maths.normalizeVector(n1); localIncidenceAngles[1] = FastMath.acos(Maths.innerProduct(n1, s)) * Constants.RTOD; Maths.normalizeVector(n); if (Maths.innerProduct(n, c) < 0) { n.x = -n.x; lg.sensorPos.y - centrePoint.y, lg.sensorPos.z - centrePoint.z); Maths.normalizeVector(s); Maths.normalizeVector(m); final double mnInnerProduct = Maths.innerProduct(m, n); final PosVector n1 = new PosVector(n.x - m.x * mnInnerProduct, n.y - m.y * mnInnerProduct, n.z - m.z * mnInnerProduct); Maths.normalizeVector(n1); localIncidenceAngles[1] = FastMath.acos(Maths.innerProduct(n1, s)) * Constants.RTOD;