Changes in this commit seem to be the result of some "auto reformat" tool execution. The Java - GeoAPI - GeoTools import ordering is altered, imports used only in Javadoc are lost and the encoding of non-ASCII characters is broken. This commit has been reverted, except for the removal of really unused imports which are kept removed.
Command line:
svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r10795:10796 https://svn.osgeo.org/geotools/trunk/modules/library/metadata/src/main/java/org/geotools/math/Line.java
Revision 10795 | Revision 10796 |
---|---|
/* * Geotools 2 - OpenSource mapping toolkit * (C) 2003, Geotools Project Managment Committee (PMC) * (C) 2003, Institut de Recherche pour le Développement * (C) 1998, Pêches et Océans Canada * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public |
/* * Geotools 2 - OpenSource mapping toolkit * (C) 2003, Geotools Project Managment Committee (PMC) * (C) 2003, Institut de Recherche pour le D�veloppement * (C) 1998, P�ches et Oc�ans Canada * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public |
// J2SE dependencies import java.awt.geom.Line2D; import java.awt.geom.Point2D; import javax.vecmath.MismatchedSizeException; import java.io.Serializable; // OpenGIS dependencies import org.opengis.util.Cloneable; |
// J2SE dependencies
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.io.Serializable;
import javax.vecmath.MismatchedSizeException;
import org.opengis.util.Cloneable; |
* We have to solve two equations with two unknows: * * 1) mean(y) = b + m*mean(x) * 2) mean(xy) = b*mean(x) + m*mean(x²) * * Those formulas lead to a quadratic equation. However, * the formulas become very simples if we set 'mean(x)=0'. * We can achieve this result by computing instead of (2): * * 2b) mean(dx y) = m*mean(dx²) * * where dx=x-mean(x). In this case mean(dx)==0. */ |
* We have to solve two equations with two unknows: * * 1) mean(y) = b + m*mean(x) * 2) mean(xy) = b*mean(x) + m*mean(x�) * * Those formulas lead to a quadratic equation. However, * the formulas become very simples if we set 'mean(x)=0'. * We can achieve this result by computing instead of (2): * * 2b) mean(dx y) = m*mean(dx�) * * where dx=x-mean(x). In this case mean(dx)==0. */ |
* Assuming that 'mean(x)==0', then the correlation
* coefficient can be approximate by:
*
* R = mean(xy) / sqrt( mean(x²) * (mean(y²) - mean(y)²) )
*/
slope = mean_xy/mean_x2;
y0 = mean_y-mean_x*slope; |
* Assuming that 'mean(x)==0', then the correlation
* coefficient can be approximate by:
*
* R = mean(xy) / sqrt( mean(x�) * (mean(y�) - mean(y)�) )
*/
slope = mean_xy/mean_x2;
y0 = mean_y-mean_x*slope; |