You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2013/02/07 10:28:05 UTC
svn commit: r1443364 -
/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.java
Author: luc
Date: Thu Feb 7 09:28:04 2013
New Revision: 1443364
URL: http://svn.apache.org/viewvc?rev=1443364&view=rev
Log:
Fix typo and avoid computing an unused element.
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.java
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.java?rev=1443364&r1=1443363&r2=1443364&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.java Thu Feb 7 09:28:04 2013
@@ -64,10 +64,10 @@ public class SphericalCoordinates implem
/** Azimuthal angle in the x-y plane θ. */
private final double theta;
- /** Polar angle (co-latitude) φ. */
+ /** Polar angle (co-latitude) Φ. */
private final double phi;
- /** Jacobian of (r, θ &phi). */
+ /** Jacobian of (r, θ &Phi). */
private double[][] jacobian;
/** Hessian of radius. */
@@ -96,7 +96,7 @@ public class SphericalCoordinates implem
/** Build a spherical coordinates transformer from spherical coordinates.
* @param r radius
- * @param theta azimuthal angle in x-y place
+ * @param theta azimuthal angle in x-y plane
* @param phi polar (co-latitude) angle
*/
public SphericalCoordinates(final double r, final double theta, final double phi) {
@@ -188,7 +188,7 @@ public class SphericalCoordinates implem
* @param sGradient gradient with respect to spherical coordinates
* {df/dr, df/dθ, df/dΦ}
* @return Hessian with respect to Cartesian coordinates
- * {{d<sup>2</sup>f/dx<sup>2</sup>, d<sup>2</sup>f/rGradient.getY(), d<sup>2</sup>f/dxdz},
+ * {{d<sup>2</sup>f/dx<sup>2</sup>, d<sup>2</sup>f/dxdy, d<sup>2</sup>f/dxdz},
* {d<sup>2</sup>f/dxdy, d<sup>2</sup>f/dy<sup>2</sup>, d<sup>2</sup>f/dydz},
* {d<sup>2</sup>f/dxdz, d<sup>2</sup>f/dydz, d<sup>2</sup>f/dz<sup>2</sup>}}
*/
@@ -210,7 +210,7 @@ public class SphericalCoordinates implem
hj[0][2] = sHessian[0][0] * jacobian[0][2] + sHessian[2][0] * jacobian[2][2];
hj[1][0] = sHessian[1][0] * jacobian[0][0] + sHessian[1][1] * jacobian[1][0] + sHessian[2][1] * jacobian[2][0];
hj[1][1] = sHessian[1][0] * jacobian[0][1] + sHessian[1][1] * jacobian[1][1] + sHessian[2][1] * jacobian[2][1];
- hj[1][2] = sHessian[1][0] * jacobian[0][2] + sHessian[2][1] * jacobian[2][2];
+ // don't compute hj[1][2] as it is not used below
hj[2][0] = sHessian[2][0] * jacobian[0][0] + sHessian[2][1] * jacobian[1][0] + sHessian[2][2] * jacobian[2][0];
hj[2][1] = sHessian[2][0] * jacobian[0][1] + sHessian[2][1] * jacobian[1][1] + sHessian[2][2] * jacobian[2][1];
hj[2][2] = sHessian[2][0] * jacobian[0][2] + sHessian[2][2] * jacobian[2][2];