commons-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r959802 [4/10] - in /websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3: fraction/ geometry/euclidean/threed/ geometry/euclidean/twod/ ml/neuralnet/ ml/neuralnet/sofm/ ode/ ode/events/ special/ stat/infere...
Date Mon, 27 Jul 2015 19:40:45 GMT
Modified: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/geometry/euclidean/twod/Line.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/geometry/euclidean/twod/Line.html
(original)
+++ websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/geometry/euclidean/twod/Line.html
Mon Jul 27 19:40:45 2015
@@ -455,97 +455,130 @@
 <a class="jxr_linenumber" name="L447" href="#L447">447</a> <em class="jxr_javadoccomment">
    * org.apache.commons.math3.geometry.partitioning.SubHyperplane</em>
 <a class="jxr_linenumber" name="L448" href="#L448">448</a> <em class="jxr_javadoccomment">
    * SubHyperplane} instances</em>
 <a class="jxr_linenumber" name="L449" href="#L449">449</a> <em class="jxr_javadoccomment">
    * @exception MathIllegalArgumentException if the transform is non invertible</em>
-<a class="jxr_linenumber" name="L450" href="#L450">450</a> <em class="jxr_javadoccomment">
    */</em>
-<a class="jxr_linenumber" name="L451" href="#L451">451</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">static</strong> Transform&lt;Euclidean2D, Euclidean1D&gt;
getTransform(<strong class="jxr_keyword">final</strong> AffineTransform transform)
-<a class="jxr_linenumber" name="L452" href="#L452">452</a>         <strong
class="jxr_keyword">throws</strong> <a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html">MathIllegalArgumentException</a>
{
-<a class="jxr_linenumber" name="L453" href="#L453">453</a>         <strong
class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong>
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">LineTransform</a>(transform);
-<a class="jxr_linenumber" name="L454" href="#L454">454</a>     }
-<a class="jxr_linenumber" name="L455" href="#L455">455</a> 
-<a class="jxr_linenumber" name="L456" href="#L456">456</a>     <em class="jxr_javadoccomment">/**
Class embedding an affine transform.</em>
-<a class="jxr_linenumber" name="L457" href="#L457">457</a> <em class="jxr_javadoccomment">
    * &lt;p&gt;This class is used in order to apply an affine transform to a</em>
-<a class="jxr_linenumber" name="L458" href="#L458">458</a> <em class="jxr_javadoccomment">
    * line. Using a specific object allow to perform some computations</em>
-<a class="jxr_linenumber" name="L459" href="#L459">459</a> <em class="jxr_javadoccomment">
    * on the transform only once even if the same transform is to be</em>
-<a class="jxr_linenumber" name="L460" href="#L460">460</a> <em class="jxr_javadoccomment">
    * applied to a large number of lines (for example to a large</em>
-<a class="jxr_linenumber" name="L461" href="#L461">461</a> <em class="jxr_javadoccomment">
    * polygon)./&lt;p&gt;</em>
-<a class="jxr_linenumber" name="L462" href="#L462">462</a> <em class="jxr_javadoccomment">
    */</em>
-<a class="jxr_linenumber" name="L463" href="#L463">463</a>     <strong class="jxr_keyword">private</strong>
<strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">class</strong>
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">LineTransform</a>
<strong class="jxr_keyword">implements</strong> Transform&lt;Euclidean2D,
Euclidean1D&gt; {
-<a class="jxr_linenumber" name="L464" href="#L464">464</a> 
-<a class="jxr_linenumber" name="L465" href="#L465">465</a>         <em class="jxr_comment">//
CHECKSTYLE: stop JavadocVariable check</em>
-<a class="jxr_linenumber" name="L466" href="#L466">466</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
cXX;
-<a class="jxr_linenumber" name="L467" href="#L467">467</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
cXY;
-<a class="jxr_linenumber" name="L468" href="#L468">468</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
cX1;
-<a class="jxr_linenumber" name="L469" href="#L469">469</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
cYX;
-<a class="jxr_linenumber" name="L470" href="#L470">470</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
cYY;
-<a class="jxr_linenumber" name="L471" href="#L471">471</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
cY1;
-<a class="jxr_linenumber" name="L472" href="#L472">472</a> 
-<a class="jxr_linenumber" name="L473" href="#L473">473</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
c1Y;
-<a class="jxr_linenumber" name="L474" href="#L474">474</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
c1X;
-<a class="jxr_linenumber" name="L475" href="#L475">475</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
c11;
-<a class="jxr_linenumber" name="L476" href="#L476">476</a>         <em class="jxr_comment">//
CHECKSTYLE: resume JavadocVariable check</em>
-<a class="jxr_linenumber" name="L477" href="#L477">477</a> 
-<a class="jxr_linenumber" name="L478" href="#L478">478</a>         <em class="jxr_javadoccomment">/**
Build an affine line transform from a n {@code AffineTransform}.</em>
-<a class="jxr_linenumber" name="L479" href="#L479">479</a> <em class="jxr_javadoccomment">
        * @param transform transform to use (must be invertible otherwise</em>
-<a class="jxr_linenumber" name="L480" href="#L480">480</a> <em class="jxr_javadoccomment">
        * the {@link LineTransform#apply(Hyperplane)} method would work</em>
-<a class="jxr_linenumber" name="L481" href="#L481">481</a> <em class="jxr_javadoccomment">
        * only for some lines, and fail for other ones)</em>
-<a class="jxr_linenumber" name="L482" href="#L482">482</a> <em class="jxr_javadoccomment">
        * @exception MathIllegalArgumentException if the transform is non invertible</em>
-<a class="jxr_linenumber" name="L483" href="#L483">483</a> <em class="jxr_javadoccomment">
        */</em>
-<a class="jxr_linenumber" name="L484" href="#L484">484</a>         <strong
class="jxr_keyword">public</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">LineTransform</a>(<strong
class="jxr_keyword">final</strong> AffineTransform transform) <strong class="jxr_keyword">throws</strong>
MathIllegalArgumentException {
-<a class="jxr_linenumber" name="L485" href="#L485">485</a> 
-<a class="jxr_linenumber" name="L486" href="#L486">486</a>             <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>[]
m = <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[6];
-<a class="jxr_linenumber" name="L487" href="#L487">487</a>             transform.getMatrix(m);
-<a class="jxr_linenumber" name="L488" href="#L488">488</a>             cXX =
m[0];
-<a class="jxr_linenumber" name="L489" href="#L489">489</a>             cXY =
m[2];
-<a class="jxr_linenumber" name="L490" href="#L490">490</a>             cX1 =
m[4];
-<a class="jxr_linenumber" name="L491" href="#L491">491</a>             cYX =
m[1];
-<a class="jxr_linenumber" name="L492" href="#L492">492</a>             cYY =
m[3];
-<a class="jxr_linenumber" name="L493" href="#L493">493</a>             cY1 =
m[5];
-<a class="jxr_linenumber" name="L494" href="#L494">494</a> 
-<a class="jxr_linenumber" name="L495" href="#L495">495</a>             c1Y =
MathArrays.linearCombination(cXY, cY1, -cYY, cX1);
-<a class="jxr_linenumber" name="L496" href="#L496">496</a>             c1X =
MathArrays.linearCombination(cXX, cY1, -cYX, cX1);
-<a class="jxr_linenumber" name="L497" href="#L497">497</a>             c11 =
MathArrays.linearCombination(cXX, cYY, -cYX, cXY);
-<a class="jxr_linenumber" name="L498" href="#L498">498</a> 
-<a class="jxr_linenumber" name="L499" href="#L499">499</a>             <strong
class="jxr_keyword">if</strong> (FastMath.abs(c11) &lt; 1.0e-20) {
-<a class="jxr_linenumber" name="L500" href="#L500">500</a>                 <strong
class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong>
<a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html">MathIllegalArgumentException</a>(LocalizedFormats.NON_INVERTIBLE_TRANSFORM);
-<a class="jxr_linenumber" name="L501" href="#L501">501</a>             }
-<a class="jxr_linenumber" name="L502" href="#L502">502</a> 
-<a class="jxr_linenumber" name="L503" href="#L503">503</a>         }
-<a class="jxr_linenumber" name="L504" href="#L504">504</a> 
-<a class="jxr_linenumber" name="L505" href="#L505">505</a>         <em class="jxr_javadoccomment">/**
{@inheritDoc} */</em>
-<a class="jxr_linenumber" name="L506" href="#L506">506</a>         <strong
class="jxr_keyword">public</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Vector2D.html">Vector2D</a>
apply(<strong class="jxr_keyword">final</strong> Point&lt;Euclidean2D&gt;
point) {
-<a class="jxr_linenumber" name="L507" href="#L507">507</a>             <strong
class="jxr_keyword">final</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Vector2D.html">Vector2D</a>
p2D = (Vector2D) point;
-<a class="jxr_linenumber" name="L508" href="#L508">508</a>             <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
 x   = p2D.getX();
-<a class="jxr_linenumber" name="L509" href="#L509">509</a>             <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
 y   = p2D.getY();
-<a class="jxr_linenumber" name="L510" href="#L510">510</a>             <strong
class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong>
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Vector2D.html">Vector2D</a>(MathArrays.linearCombination(cXX,
x, cXY, y, cX1, 1),
-<a class="jxr_linenumber" name="L511" href="#L511">511</a>                  
              MathArrays.linearCombination(cYX, x, cYY, y, cY1, 1));
-<a class="jxr_linenumber" name="L512" href="#L512">512</a>         }
-<a class="jxr_linenumber" name="L513" href="#L513">513</a> 
-<a class="jxr_linenumber" name="L514" href="#L514">514</a>         <em class="jxr_javadoccomment">/**
{@inheritDoc} */</em>
-<a class="jxr_linenumber" name="L515" href="#L515">515</a>         <strong
class="jxr_keyword">public</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">Line</a>
apply(<strong class="jxr_keyword">final</strong> Hyperplane&lt;Euclidean2D&gt;
hyperplane) {
-<a class="jxr_linenumber" name="L516" href="#L516">516</a>             <strong
class="jxr_keyword">final</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">Line</a>
  line    = (Line) hyperplane;
-<a class="jxr_linenumber" name="L517" href="#L517">517</a>             <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
rOffset = MathArrays.linearCombination(c1X, line.cos, c1Y, line.sin, c11, line.originOffset);
-<a class="jxr_linenumber" name="L518" href="#L518">518</a>             <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
rCos    = MathArrays.linearCombination(cXX, line.cos, cXY, line.sin);
-<a class="jxr_linenumber" name="L519" href="#L519">519</a>             <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
rSin    = MathArrays.linearCombination(cYX, line.cos, cYY, line.sin);
-<a class="jxr_linenumber" name="L520" href="#L520">520</a>             <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
inv     = 1.0 / FastMath.sqrt(rSin * rSin + rCos * rCos);
-<a class="jxr_linenumber" name="L521" href="#L521">521</a>             <strong
class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong>
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">Line</a>(FastMath.PI
+ FastMath.atan2(-rSin, -rCos),
-<a class="jxr_linenumber" name="L522" href="#L522">522</a>                  
          inv * rCos, inv * rSin,
-<a class="jxr_linenumber" name="L523" href="#L523">523</a>                  
          inv * rOffset, line.tolerance);
-<a class="jxr_linenumber" name="L524" href="#L524">524</a>         }
-<a class="jxr_linenumber" name="L525" href="#L525">525</a> 
-<a class="jxr_linenumber" name="L526" href="#L526">526</a>         <em class="jxr_javadoccomment">/**
{@inheritDoc} */</em>
-<a class="jxr_linenumber" name="L527" href="#L527">527</a>         <strong
class="jxr_keyword">public</strong> SubHyperplane&lt;Euclidean1D&gt; apply(<strong
class="jxr_keyword">final</strong> SubHyperplane&lt;Euclidean1D&gt; sub,
-<a class="jxr_linenumber" name="L528" href="#L528">528</a>                  
                              <strong class="jxr_keyword">final</strong> Hyperplane&lt;Euclidean2D&gt;
original,
-<a class="jxr_linenumber" name="L529" href="#L529">529</a>                  
                              <strong class="jxr_keyword">final</strong> Hyperplane&lt;Euclidean2D&gt;
transformed) {
-<a class="jxr_linenumber" name="L530" href="#L530">530</a>             <strong
class="jxr_keyword">final</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/oned/OrientedPoint.html">OrientedPoint</a>
op     = (OrientedPoint) sub.getHyperplane();
-<a class="jxr_linenumber" name="L531" href="#L531">531</a>             <strong
class="jxr_keyword">final</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">Line</a>
originalLine    = (Line) original;
-<a class="jxr_linenumber" name="L532" href="#L532">532</a>             <strong
class="jxr_keyword">final</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">Line</a>
transformedLine = (Line) transformed;
-<a class="jxr_linenumber" name="L533" href="#L533">533</a>             <strong
class="jxr_keyword">final</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/oned/Vector1D.html">Vector1D</a>
newLoc =
-<a class="jxr_linenumber" name="L534" href="#L534">534</a>                 transformedLine.toSubSpace(apply(originalLine.toSpace(op.getLocation())));
-<a class="jxr_linenumber" name="L535" href="#L535">535</a>             <strong
class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong>
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/oned/OrientedPoint.html">OrientedPoint</a>(newLoc,
op.isDirect(), originalLine.tolerance).wholeHyperplane();
+<a class="jxr_linenumber" name="L450" href="#L450">450</a> <em class="jxr_javadoccomment">
    * @deprecated as of 3.6, replaced with {@link #getTransform(double, double, double, double,
double, double)}</em>
+<a class="jxr_linenumber" name="L451" href="#L451">451</a> <em class="jxr_javadoccomment">
    */</em>
+<a class="jxr_linenumber" name="L452" href="#L452">452</a>     @Deprecated
+<a class="jxr_linenumber" name="L453" href="#L453">453</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">static</strong> Transform&lt;Euclidean2D, Euclidean1D&gt;
getTransform(<strong class="jxr_keyword">final</strong> AffineTransform transform)
+<a class="jxr_linenumber" name="L454" href="#L454">454</a>         <strong
class="jxr_keyword">throws</strong> <a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html">MathIllegalArgumentException</a>
{
+<a class="jxr_linenumber" name="L455" href="#L455">455</a>         <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>[]
m = <strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[6];
+<a class="jxr_linenumber" name="L456" href="#L456">456</a>         transform.getMatrix(m);
+<a class="jxr_linenumber" name="L457" href="#L457">457</a>         <strong
class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong>
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">LineTransform</a>(m[0],
m[1], m[2], m[3], m[4], m[5]);
+<a class="jxr_linenumber" name="L458" href="#L458">458</a>     }
+<a class="jxr_linenumber" name="L459" href="#L459">459</a> 
+<a class="jxr_linenumber" name="L460" href="#L460">460</a>     <em class="jxr_javadoccomment">/**
Get a {@link org.apache.commons.math3.geometry.partitioning.Transform</em>
+<a class="jxr_linenumber" name="L461" href="#L461">461</a> <em class="jxr_javadoccomment">
    * Transform} embedding an affine transform.</em>
+<a class="jxr_linenumber" name="L462" href="#L462">462</a> <em class="jxr_javadoccomment">
    * @param cXX transform factor between input abscissa and output abscissa</em>
+<a class="jxr_linenumber" name="L463" href="#L463">463</a> <em class="jxr_javadoccomment">
    * @param cYX transform factor between input abscissa and output ordinate</em>
+<a class="jxr_linenumber" name="L464" href="#L464">464</a> <em class="jxr_javadoccomment">
    * @param cXY transform factor between input ordinate and output abscissa</em>
+<a class="jxr_linenumber" name="L465" href="#L465">465</a> <em class="jxr_javadoccomment">
    * @param cYY transform factor between input ordinate and output ordinate</em>
+<a class="jxr_linenumber" name="L466" href="#L466">466</a> <em class="jxr_javadoccomment">
    * @param cX1 transform addendum for output abscissa</em>
+<a class="jxr_linenumber" name="L467" href="#L467">467</a> <em class="jxr_javadoccomment">
    * @param cY1 transform addendum for output ordinate</em>
+<a class="jxr_linenumber" name="L468" href="#L468">468</a> <em class="jxr_javadoccomment">
    * @return a new transform that can be applied to either {@link</em>
+<a class="jxr_linenumber" name="L469" href="#L469">469</a> <em class="jxr_javadoccomment">
    * Vector2D Vector2D}, {@link Line Line} or {@link</em>
+<a class="jxr_linenumber" name="L470" href="#L470">470</a> <em class="jxr_javadoccomment">
    * org.apache.commons.math3.geometry.partitioning.SubHyperplane</em>
+<a class="jxr_linenumber" name="L471" href="#L471">471</a> <em class="jxr_javadoccomment">
    * SubHyperplane} instances</em>
+<a class="jxr_linenumber" name="L472" href="#L472">472</a> <em class="jxr_javadoccomment">
    * @exception MathIllegalArgumentException if the transform is non invertible</em>
+<a class="jxr_linenumber" name="L473" href="#L473">473</a> <em class="jxr_javadoccomment">
    * @since 3.6</em>
+<a class="jxr_linenumber" name="L474" href="#L474">474</a> <em class="jxr_javadoccomment">
    */</em>
+<a class="jxr_linenumber" name="L475" href="#L475">475</a>     <strong class="jxr_keyword">public</strong>
<strong class="jxr_keyword">static</strong> Transform&lt;Euclidean2D, Euclidean1D&gt;
getTransform(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
cXX,
+<a class="jxr_linenumber" name="L476" href="#L476">476</a>                  
                                                 <strong class="jxr_keyword">final</strong>
<strong class="jxr_keyword">double</strong> cYX,
+<a class="jxr_linenumber" name="L477" href="#L477">477</a>                  
                                                 <strong class="jxr_keyword">final</strong>
<strong class="jxr_keyword">double</strong> cXY,
+<a class="jxr_linenumber" name="L478" href="#L478">478</a>                  
                                                 <strong class="jxr_keyword">final</strong>
<strong class="jxr_keyword">double</strong> cYY,
+<a class="jxr_linenumber" name="L479" href="#L479">479</a>                  
                                                 <strong class="jxr_keyword">final</strong>
<strong class="jxr_keyword">double</strong> cX1,
+<a class="jxr_linenumber" name="L480" href="#L480">480</a>                  
                                                 <strong class="jxr_keyword">final</strong>
<strong class="jxr_keyword">double</strong> cY1)
+<a class="jxr_linenumber" name="L481" href="#L481">481</a>         <strong
class="jxr_keyword">throws</strong> <a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html">MathIllegalArgumentException</a>
{
+<a class="jxr_linenumber" name="L482" href="#L482">482</a>         <strong
class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong>
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">LineTransform</a>(cXX,
cYX, cXY, cYY, cX1, cY1);
+<a class="jxr_linenumber" name="L483" href="#L483">483</a>     }
+<a class="jxr_linenumber" name="L484" href="#L484">484</a> 
+<a class="jxr_linenumber" name="L485" href="#L485">485</a>     <em class="jxr_javadoccomment">/**
Class embedding an affine transform.</em>
+<a class="jxr_linenumber" name="L486" href="#L486">486</a> <em class="jxr_javadoccomment">
    * &lt;p&gt;This class is used in order to apply an affine transform to a</em>
+<a class="jxr_linenumber" name="L487" href="#L487">487</a> <em class="jxr_javadoccomment">
    * line. Using a specific object allow to perform some computations</em>
+<a class="jxr_linenumber" name="L488" href="#L488">488</a> <em class="jxr_javadoccomment">
    * on the transform only once even if the same transform is to be</em>
+<a class="jxr_linenumber" name="L489" href="#L489">489</a> <em class="jxr_javadoccomment">
    * applied to a large number of lines (for example to a large</em>
+<a class="jxr_linenumber" name="L490" href="#L490">490</a> <em class="jxr_javadoccomment">
    * polygon)./&lt;p&gt;</em>
+<a class="jxr_linenumber" name="L491" href="#L491">491</a> <em class="jxr_javadoccomment">
    */</em>
+<a class="jxr_linenumber" name="L492" href="#L492">492</a>     <strong class="jxr_keyword">private</strong>
<strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">class</strong>
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">LineTransform</a>
<strong class="jxr_keyword">implements</strong> Transform&lt;Euclidean2D,
Euclidean1D&gt; {
+<a class="jxr_linenumber" name="L493" href="#L493">493</a> 
+<a class="jxr_linenumber" name="L494" href="#L494">494</a>         <em class="jxr_comment">//
CHECKSTYLE: stop JavadocVariable check</em>
+<a class="jxr_linenumber" name="L495" href="#L495">495</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
cXX;
+<a class="jxr_linenumber" name="L496" href="#L496">496</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
cXY;
+<a class="jxr_linenumber" name="L497" href="#L497">497</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
cX1;
+<a class="jxr_linenumber" name="L498" href="#L498">498</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
cYX;
+<a class="jxr_linenumber" name="L499" href="#L499">499</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
cYY;
+<a class="jxr_linenumber" name="L500" href="#L500">500</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
cY1;
+<a class="jxr_linenumber" name="L501" href="#L501">501</a> 
+<a class="jxr_linenumber" name="L502" href="#L502">502</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
c1Y;
+<a class="jxr_linenumber" name="L503" href="#L503">503</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
c1X;
+<a class="jxr_linenumber" name="L504" href="#L504">504</a>         <strong
class="jxr_keyword">private</strong> <strong class="jxr_keyword">double</strong>
c11;
+<a class="jxr_linenumber" name="L505" href="#L505">505</a>         <em class="jxr_comment">//
CHECKSTYLE: resume JavadocVariable check</em>
+<a class="jxr_linenumber" name="L506" href="#L506">506</a> 
+<a class="jxr_linenumber" name="L507" href="#L507">507</a>         <em class="jxr_javadoccomment">/**
Build an affine line transform from a n {@code AffineTransform}.</em>
+<a class="jxr_linenumber" name="L508" href="#L508">508</a> <em class="jxr_javadoccomment">
        * @param cXX transform factor between input abscissa and output abscissa</em>
+<a class="jxr_linenumber" name="L509" href="#L509">509</a> <em class="jxr_javadoccomment">
        * @param cYX transform factor between input abscissa and output ordinate</em>
+<a class="jxr_linenumber" name="L510" href="#L510">510</a> <em class="jxr_javadoccomment">
        * @param cXY transform factor between input ordinate and output abscissa</em>
+<a class="jxr_linenumber" name="L511" href="#L511">511</a> <em class="jxr_javadoccomment">
        * @param cYY transform factor between input ordinate and output ordinate</em>
+<a class="jxr_linenumber" name="L512" href="#L512">512</a> <em class="jxr_javadoccomment">
        * @param cX1 transform addendum for output abscissa</em>
+<a class="jxr_linenumber" name="L513" href="#L513">513</a> <em class="jxr_javadoccomment">
        * @param cY1 transform addendum for output ordinate</em>
+<a class="jxr_linenumber" name="L514" href="#L514">514</a> <em class="jxr_javadoccomment">
        * @exception MathIllegalArgumentException if the transform is non invertible</em>
+<a class="jxr_linenumber" name="L515" href="#L515">515</a> <em class="jxr_javadoccomment">
        * @since 3.6</em>
+<a class="jxr_linenumber" name="L516" href="#L516">516</a> <em class="jxr_javadoccomment">
        */</em>
+<a class="jxr_linenumber" name="L517" href="#L517">517</a>         <strong
class="jxr_keyword">public</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">LineTransform</a>(<strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
cXX, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
cYX, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
cXY,
+<a class="jxr_linenumber" name="L518" href="#L518">518</a>                  
           <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
cYY, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
cX1, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
cY1)
+<a class="jxr_linenumber" name="L519" href="#L519">519</a>             <strong
class="jxr_keyword">throws</strong> <a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html">MathIllegalArgumentException</a>
{
+<a class="jxr_linenumber" name="L520" href="#L520">520</a> 
+<a class="jxr_linenumber" name="L521" href="#L521">521</a>             <strong
class="jxr_keyword">this</strong>.cXX = cXX;
+<a class="jxr_linenumber" name="L522" href="#L522">522</a>             <strong
class="jxr_keyword">this</strong>.cYX = cYX;
+<a class="jxr_linenumber" name="L523" href="#L523">523</a>             <strong
class="jxr_keyword">this</strong>.cXY = cXY;
+<a class="jxr_linenumber" name="L524" href="#L524">524</a>             <strong
class="jxr_keyword">this</strong>.cYY = cYY;
+<a class="jxr_linenumber" name="L525" href="#L525">525</a>             <strong
class="jxr_keyword">this</strong>.cX1 = cX1;
+<a class="jxr_linenumber" name="L526" href="#L526">526</a>             <strong
class="jxr_keyword">this</strong>.cY1 = cY1;
+<a class="jxr_linenumber" name="L527" href="#L527">527</a> 
+<a class="jxr_linenumber" name="L528" href="#L528">528</a>             c1Y =
MathArrays.linearCombination(cXY, cY1, -cYY, cX1);
+<a class="jxr_linenumber" name="L529" href="#L529">529</a>             c1X =
MathArrays.linearCombination(cXX, cY1, -cYX, cX1);
+<a class="jxr_linenumber" name="L530" href="#L530">530</a>             c11 =
MathArrays.linearCombination(cXX, cYY, -cYX, cXY);
+<a class="jxr_linenumber" name="L531" href="#L531">531</a> 
+<a class="jxr_linenumber" name="L532" href="#L532">532</a>             <strong
class="jxr_keyword">if</strong> (FastMath.abs(c11) &lt; 1.0e-20) {
+<a class="jxr_linenumber" name="L533" href="#L533">533</a>                 <strong
class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong>
<a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html">MathIllegalArgumentException</a>(LocalizedFormats.NON_INVERTIBLE_TRANSFORM);
+<a class="jxr_linenumber" name="L534" href="#L534">534</a>             }
+<a class="jxr_linenumber" name="L535" href="#L535">535</a> 
 <a class="jxr_linenumber" name="L536" href="#L536">536</a>         }
 <a class="jxr_linenumber" name="L537" href="#L537">537</a> 
-<a class="jxr_linenumber" name="L538" href="#L538">538</a>     }
-<a class="jxr_linenumber" name="L539" href="#L539">539</a> 
-<a class="jxr_linenumber" name="L540" href="#L540">540</a> }
+<a class="jxr_linenumber" name="L538" href="#L538">538</a>         <em class="jxr_javadoccomment">/**
{@inheritDoc} */</em>
+<a class="jxr_linenumber" name="L539" href="#L539">539</a>         <strong
class="jxr_keyword">public</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Vector2D.html">Vector2D</a>
apply(<strong class="jxr_keyword">final</strong> Point&lt;Euclidean2D&gt;
point) {
+<a class="jxr_linenumber" name="L540" href="#L540">540</a>             <strong
class="jxr_keyword">final</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Vector2D.html">Vector2D</a>
p2D = (Vector2D) point;
+<a class="jxr_linenumber" name="L541" href="#L541">541</a>             <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
 x   = p2D.getX();
+<a class="jxr_linenumber" name="L542" href="#L542">542</a>             <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
 y   = p2D.getY();
+<a class="jxr_linenumber" name="L543" href="#L543">543</a>             <strong
class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong>
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Vector2D.html">Vector2D</a>(MathArrays.linearCombination(cXX,
x, cXY, y, cX1, 1),
+<a class="jxr_linenumber" name="L544" href="#L544">544</a>                  
              MathArrays.linearCombination(cYX, x, cYY, y, cY1, 1));
+<a class="jxr_linenumber" name="L545" href="#L545">545</a>         }
+<a class="jxr_linenumber" name="L546" href="#L546">546</a> 
+<a class="jxr_linenumber" name="L547" href="#L547">547</a>         <em class="jxr_javadoccomment">/**
{@inheritDoc} */</em>
+<a class="jxr_linenumber" name="L548" href="#L548">548</a>         <strong
class="jxr_keyword">public</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">Line</a>
apply(<strong class="jxr_keyword">final</strong> Hyperplane&lt;Euclidean2D&gt;
hyperplane) {
+<a class="jxr_linenumber" name="L549" href="#L549">549</a>             <strong
class="jxr_keyword">final</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">Line</a>
  line    = (Line) hyperplane;
+<a class="jxr_linenumber" name="L550" href="#L550">550</a>             <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
rOffset = MathArrays.linearCombination(c1X, line.cos, c1Y, line.sin, c11, line.originOffset);
+<a class="jxr_linenumber" name="L551" href="#L551">551</a>             <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
rCos    = MathArrays.linearCombination(cXX, line.cos, cXY, line.sin);
+<a class="jxr_linenumber" name="L552" href="#L552">552</a>             <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
rSin    = MathArrays.linearCombination(cYX, line.cos, cYY, line.sin);
+<a class="jxr_linenumber" name="L553" href="#L553">553</a>             <strong
class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>
inv     = 1.0 / FastMath.sqrt(rSin * rSin + rCos * rCos);
+<a class="jxr_linenumber" name="L554" href="#L554">554</a>             <strong
class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong>
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">Line</a>(FastMath.PI
+ FastMath.atan2(-rSin, -rCos),
+<a class="jxr_linenumber" name="L555" href="#L555">555</a>                  
          inv * rCos, inv * rSin,
+<a class="jxr_linenumber" name="L556" href="#L556">556</a>                  
          inv * rOffset, line.tolerance);
+<a class="jxr_linenumber" name="L557" href="#L557">557</a>         }
+<a class="jxr_linenumber" name="L558" href="#L558">558</a> 
+<a class="jxr_linenumber" name="L559" href="#L559">559</a>         <em class="jxr_javadoccomment">/**
{@inheritDoc} */</em>
+<a class="jxr_linenumber" name="L560" href="#L560">560</a>         <strong
class="jxr_keyword">public</strong> SubHyperplane&lt;Euclidean1D&gt; apply(<strong
class="jxr_keyword">final</strong> SubHyperplane&lt;Euclidean1D&gt; sub,
+<a class="jxr_linenumber" name="L561" href="#L561">561</a>                  
                              <strong class="jxr_keyword">final</strong> Hyperplane&lt;Euclidean2D&gt;
original,
+<a class="jxr_linenumber" name="L562" href="#L562">562</a>                  
                              <strong class="jxr_keyword">final</strong> Hyperplane&lt;Euclidean2D&gt;
transformed) {
+<a class="jxr_linenumber" name="L563" href="#L563">563</a>             <strong
class="jxr_keyword">final</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/oned/OrientedPoint.html">OrientedPoint</a>
op     = (OrientedPoint) sub.getHyperplane();
+<a class="jxr_linenumber" name="L564" href="#L564">564</a>             <strong
class="jxr_keyword">final</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">Line</a>
originalLine    = (Line) original;
+<a class="jxr_linenumber" name="L565" href="#L565">565</a>             <strong
class="jxr_keyword">final</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/twod/Line.html">Line</a>
transformedLine = (Line) transformed;
+<a class="jxr_linenumber" name="L566" href="#L566">566</a>             <strong
class="jxr_keyword">final</strong> <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/oned/Vector1D.html">Vector1D</a>
newLoc =
+<a class="jxr_linenumber" name="L567" href="#L567">567</a>                 transformedLine.toSubSpace(apply(originalLine.toSpace(op.getLocation())));
+<a class="jxr_linenumber" name="L568" href="#L568">568</a>             <strong
class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong>
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/oned/OrientedPoint.html">OrientedPoint</a>(newLoc,
op.isDirect(), originalLine.tolerance).wholeHyperplane();
+<a class="jxr_linenumber" name="L569" href="#L569">569</a>         }
+<a class="jxr_linenumber" name="L570" href="#L570">570</a> 
+<a class="jxr_linenumber" name="L571" href="#L571">571</a>     }
+<a class="jxr_linenumber" name="L572" href="#L572">572</a> 
+<a class="jxr_linenumber" name="L573" href="#L573">573</a> }
 </pre>
 <hr/>
 <div id="footer">Copyright &#169; 2003&#x2013;2015 <a href="http://www.apache.org/">The
Apache Software Foundation</a>. All rights reserved.</div>



Mime
View raw message