| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.4) on Fri Sep 20 12:10:30 CEST 2019 --> |
| <title>Line (Apache SIS 1.0 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2019-09-20"> |
| <meta name="keywords" content="org.apache.sis.math.Line class"> |
| <meta name="keywords" content="slope()"> |
| <meta name="keywords" content="x0()"> |
| <meta name="keywords" content="x()"> |
| <meta name="keywords" content="y0()"> |
| <meta name="keywords" content="y()"> |
| <meta name="keywords" content="applyAsDouble()"> |
| <meta name="keywords" content="translate()"> |
| <meta name="keywords" content="setEquation()"> |
| <meta name="keywords" content="setFromPoints()"> |
| <meta name="keywords" content="fit()"> |
| <meta name="keywords" content="clone()"> |
| <meta name="keywords" content="equals()"> |
| <meta name="keywords" content="hashCode()"> |
| <meta name="keywords" content="toString()"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../sis.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="Line (Apache SIS 1.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../"; |
| var useModuleDirectories = false; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/Line.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.sis.math</a></div> |
| <h2 title="Class Line" class="title">Class Line</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>Line</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a></code>, <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Cloneable</a></code>, <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleUnaryOperator.html?is-external=true" title="class or interface in java.util.function" class="externalLink">DoubleUnaryOperator</a></code></dd> |
| </dl> |
| <hr> |
| <pre>public class <span class="typeNameLabel">Line</span> |
| extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> |
| implements <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleUnaryOperator.html?is-external=true" title="class or interface in java.util.function" class="externalLink">DoubleUnaryOperator</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Cloneable</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a></pre> |
| <div class="block">Equation of a line in a two dimensional space (<var>x</var>,<var>y</var>). |
| A line can be expressed by the <var>y</var> = <var>slope</var>⋅<var>x</var> + <var>y₀</var> equation |
| where <var>y₀</var> is the value of <var>y</var> at <var>x</var> = 0. |
| |
| <p>The equation parameters for a <code>Line</code> object can be set at construction time or using one |
| of the <code>setLine(…)</code> methods. The <var>y</var> value can be computed for a given <var>x</var> |
| value using the <a href="#y(double)"><code>y(double)</code></a> method. Method <a href="#x(double)"><code>x(double)</code></a> computes the converse and should |
| work even if the line is vertical.</p> |
| |
| <div class="note"><b>Comparison with Java2D geometries:</b> |
| At the difference of <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/geom/Line2D.html?is-external=true" title="class or interface in java.awt.geom" class="externalLink"><code>Line2D</code></a> which is bounded by (<var>x₁</var>,<var>y₁</var>) |
| and (<var>x₂</var>,<var>y₂</var>) points, <code>Line</code> objects extend toward infinity.</div></div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.5</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="Plane.html" title="class in org.apache.sis.math"><code>Plane</code></a>, |
| <a href="../referencing/operation/builder/LinearTransformBuilder.html" title="class in org.apache.sis.referencing.operation.builder"><code>LinearTransformBuilder</code></a>, |
| <a href="../../../../serialized-form.html#org.apache.sis.math.Line">Serialized Form</a></dd> |
| |
| <p><font size="-1">Defined in the <code>sis-utility</code> module</font></p> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">Line</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Constructs an uninitialized line.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(double,double)">Line</a></span>​(double slope, |
| double y0)</code></th> |
| <td class="colLast"> |
| <div class="block">Constructs a line with the specified slope and offset.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>double</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#applyAsDouble(double)">applyAsDouble</a></span>​(double x)</code></th> |
| <td class="colLast"> |
| <div class="block">Evaluates this equation for the given value.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code><a href="Line.html" title="class in org.apache.sis.math">Line</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#clone()">clone</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a clone of this line.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equals(java.lang.Object)">equals</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> object)</code></th> |
| <td class="colLast"> |
| <div class="block">Compares this line with the specified object for equality.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fit(double%5B%5D,double%5B%5D)">fit</a></span>​(double[] x, |
| double[] y)</code></th> |
| <td class="colLast"> |
| <div class="block">Given a set of data points <var>x</var>[0 … <var>n</var>-1], <var>y</var>[0 … <var>n</var>-1], |
| fits them to a straight line <var>y</var> = <var>slope</var>⋅<var>x</var> + <var>y₀</var> in a |
| least-squares senses.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>double</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fit(java.lang.Iterable)">fit</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Iterable</a><? extends <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/geometry/DirectPosition.html?is-external=true" title="class or interface in org.opengis.geometry" class="externalLink">DirectPosition</a>> points)</code></th> |
| <td class="colLast"> |
| <div class="block">Given a sequence of points, fits them to a straight line |
| <var>y</var> = <var>slope</var>⋅<var>x</var> + <var>y₀</var> in a least-squares senses.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fit(org.apache.sis.math.Vector,org.apache.sis.math.Vector)">fit</a></span>​(<a href="Vector.html" title="class in org.apache.sis.math">Vector</a> x, |
| <a href="Vector.html" title="class in org.apache.sis.math">Vector</a> y)</code></th> |
| <td class="colLast"> |
| <div class="block">Given a set of data points <var>x</var>[0 … <var>n</var>-1], <var>y</var>[0 … <var>n</var>-1], |
| fits them to a straight line <var>y</var> = <var>slope</var>⋅<var>x</var> + <var>y₀</var> in a |
| least-squares senses.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hashCode()">hashCode</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a hash code value for this line.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setEquation(double,double)">setEquation</a></span>​(double slope, |
| double y0)</code></th> |
| <td class="colLast"> |
| <div class="block">Sets this line to the specified slope and offset.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setEquation(java.lang.Number,java.lang.Number)">setEquation</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a> slope, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a> y0)</code></th> |
| <td class="colLast"> |
| <div class="block">Sets this line from values of arbitrary <code>Number</code> type.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setFromPoints(double,double,double,double)">setFromPoints</a></span>​(double x1, |
| double y1, |
| double x2, |
| double y2)</code></th> |
| <td class="colLast"> |
| <div class="block">Sets a line through the specified points.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>double</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#slope()">slope</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the slope.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString()">toString</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a string representation of this line.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#translate(double,double)">translate</a></span>​(double dx, |
| double dy)</code></th> |
| <td class="colLast"> |
| <div class="block">Translates the line.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#x(double)">x</a></span>​(double y)</code></th> |
| <td class="colLast"> |
| <div class="block">Computes <var>x</var> = <var>f</var>⁻¹(<var>y</var>).</div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>double</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#x0()">x0</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the <var>x</var> value for <var>y</var> = 0.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#y(double)">y</a></span>​(double x)</code></th> |
| <td class="colLast"> |
| <div class="block">Computes <var>y</var> = <var>f</var>(<var>x</var>).</div> |
| </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <td class="colFirst"><code>double</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#y0()">y0</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the <var>y</var> value for <var>x</var> = 0.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.DoubleUnaryOperator"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleUnaryOperator.html?is-external=true" title="class or interface in java.util.function" class="externalLink">DoubleUnaryOperator</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleUnaryOperator.html?is-external=true#andThen(java.util.function.DoubleUnaryOperator)" title="class or interface in java.util.function" class="externalLink">andThen</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleUnaryOperator.html?is-external=true#compose(java.util.function.DoubleUnaryOperator)" title="class or interface in java.util.function" class="externalLink">compose</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a id="<init>()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>Line</h4> |
| <pre>public Line()</pre> |
| <div class="block">Constructs an uninitialized line. All methods will return <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#NaN" title="class or interface in java.lang" class="externalLink"><code>Double.NaN</code></a>.</div> |
| </li> |
| </ul> |
| <a id="<init>(double,double)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>Line</h4> |
| <pre>public Line​(double slope, |
| double y0)</pre> |
| <div class="block">Constructs a line with the specified slope and offset. |
| The linear equation will be <var>y</var> = <var>slope</var>⋅<var>x</var> + <var>y₀</var>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>slope</code> - the slope.</dd> |
| <dd><code>y0</code> - the <var>y</var> value at <var>x</var> = 0.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#setEquation(double,double)"><code>setEquation(double, double)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="slope()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>slope</h4> |
| <pre class="methodSignature">public final double slope()</pre> |
| <div class="block">Returns the slope.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the slope.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#x0()"><code>x0()</code></a>, |
| <a href="#y0()"><code>y0()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="x0()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>x0</h4> |
| <pre class="methodSignature">public final double x0()</pre> |
| <div class="block">Returns the <var>x</var> value for <var>y</var> = 0. |
| Coordinate (<var>x₀</var>, 0) is the intersection point with the <var>x</var> axis.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the <var>x</var> value for <var>y</var> = 0.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#y0()"><code>y0()</code></a>, |
| <a href="#slope()"><code>slope()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="x(double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>x</h4> |
| <pre class="methodSignature">public final double x​(double y)</pre> |
| <div class="block">Computes <var>x</var> = <var>f</var>⁻¹(<var>y</var>). |
| If the line is horizontal, then this method returns an infinite value.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>y</code> - the <var>y</var> value where to evaluate the inverse function.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the <var>x</var> value for the given <var>y</var> value.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#y(double)"><code>y(double)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="y0()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>y0</h4> |
| <pre class="methodSignature">public final double y0()</pre> |
| <div class="block">Returns the <var>y</var> value for <var>x</var> = 0. |
| Coordinate (0, <var>y₀</var>) is the intersection point with the <var>y</var> axis.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the <var>y</var> value for <var>x</var> = 0.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#x0()"><code>x0()</code></a>, |
| <a href="#slope()"><code>slope()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="y(double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>y</h4> |
| <pre class="methodSignature">public final double y​(double x)</pre> |
| <div class="block">Computes <var>y</var> = <var>f</var>(<var>x</var>). |
| If the line is vertical, then this method returns an infinite value.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>x</code> - the <var>x</var> value where to evaluate the function.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the <var>y</var> value for the given <var>x</var> value.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#x(double)"><code>x(double)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="applyAsDouble(double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>applyAsDouble</h4> |
| <pre class="methodSignature">public double applyAsDouble​(double x)</pre> |
| <div class="block">Evaluates this equation for the given value. The default implementation delegates |
| to <a href="#y(double)"><code>y(x)</code></a>, but subclasses may override with different formulas. |
| This method is provided for interoperability with libraries making use of <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/package-summary.html?is-external=true" class="externalLink"><code>java.util.function</code></a>.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleUnaryOperator.html?is-external=true#applyAsDouble(double)" title="class or interface in java.util.function" class="externalLink">applyAsDouble</a></code> in interface <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleUnaryOperator.html?is-external=true" title="class or interface in java.util.function" class="externalLink">DoubleUnaryOperator</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>x</code> - the value where to evaluate the function.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the function value for the given operand.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="translate(double,double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>translate</h4> |
| <pre class="methodSignature">public void translate​(double dx, |
| double dy)</pre> |
| <div class="block">Translates the line. The slope stay unchanged.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>dx</code> - the horizontal translation.</dd> |
| <dd><code>dy</code> - the vertical translation.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setEquation(double,double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setEquation</h4> |
| <pre class="methodSignature">public void setEquation​(double slope, |
| double y0)</pre> |
| <div class="block">Sets this line to the specified slope and offset. |
| The linear equation will be <var>y</var> = <var>slope</var>⋅<var>x</var> + <var>y₀</var>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>slope</code> - the slope.</dd> |
| <dd><code>y0</code> - the <var>y</var> value at <var>x</var> = 0.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#setFromPoints(double,double,double,double)"><code>setFromPoints(double, double, double, double)</code></a>, |
| <a href="#fit(double%5B%5D,double%5B%5D)"><code>fit(double[], double[])</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setEquation(java.lang.Number,java.lang.Number)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setEquation</h4> |
| <pre class="methodSignature">public void setEquation​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a> slope, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang" class="externalLink">Number</a> y0)</pre> |
| <div class="block">Sets this line from values of arbitrary <code>Number</code> type. This method is invoked by algorithms that |
| may produce other kind of numbers (for example with different precision) than the usual <code>double</code> |
| primitive type. The default implementation delegates to <a href="#setEquation(double,double)"><code>setEquation(double, double)</code></a>, but |
| subclasses can override this method if they want to process other kind of numbers in a special way.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>slope</code> - the slope.</dd> |
| <dd><code>y0</code> - the <var>y</var> value at <var>x</var> = 0.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.8</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setFromPoints(double,double,double,double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setFromPoints</h4> |
| <pre class="methodSignature">public void setFromPoints​(double x1, |
| double y1, |
| double x2, |
| double y2)</pre> |
| <div class="block">Sets a line through the specified points. |
| The line will continue toward infinity after the points.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>x1</code> - coordinate <var>x</var> of the first point.</dd> |
| <dd><code>y1</code> - coordinate <var>y</var> of the first point.</dd> |
| <dd><code>x2</code> - coordinate <var>x</var> of the second point.</dd> |
| <dd><code>y2</code> - coordinate <var>y</var> of the second point.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="fit(double[],double[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>fit</h4> |
| <pre class="methodSignature">public double fit​(double[] x, |
| double[] y)</pre> |
| <div class="block">Given a set of data points <var>x</var>[0 … <var>n</var>-1], <var>y</var>[0 … <var>n</var>-1], |
| fits them to a straight line <var>y</var> = <var>slope</var>⋅<var>x</var> + <var>y₀</var> in a |
| least-squares senses. |
| This method assumes that the <var>x</var> values are precise and all uncertainty is in <var>y</var>. |
| |
| <p>The default implementation delegates to <a href="#fit(org.apache.sis.math.Vector,org.apache.sis.math.Vector)"><code>fit(Vector, Vector)</code></a>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>x</code> - vector of <var>x</var> values (independent variable).</dd> |
| <dd><code>y</code> - vector of <var>y</var> values (dependent variable).</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>estimation of the correlation coefficient. The closer this coefficient is to +1 or -1, the better the fit.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - if <var>x</var> and <var>y</var> do not have the same length.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="fit(org.apache.sis.math.Vector,org.apache.sis.math.Vector)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>fit</h4> |
| <pre class="methodSignature">public double fit​(<a href="Vector.html" title="class in org.apache.sis.math">Vector</a> x, |
| <a href="Vector.html" title="class in org.apache.sis.math">Vector</a> y)</pre> |
| <div class="block">Given a set of data points <var>x</var>[0 … <var>n</var>-1], <var>y</var>[0 … <var>n</var>-1], |
| fits them to a straight line <var>y</var> = <var>slope</var>⋅<var>x</var> + <var>y₀</var> in a |
| least-squares senses. |
| This method assumes that the <var>x</var> values are precise and all uncertainty is in <var>y</var>. |
| |
| <p>The default implementation delegates to <a href="#fit(java.lang.Iterable)"><code>fit(Iterable)</code></a>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>x</code> - vector of <var>x</var> values (independent variable).</dd> |
| <dd><code>y</code> - vector of <var>y</var> values (dependent variable).</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>estimation of the correlation coefficient. The closer this coefficient is to +1 or -1, the better the fit.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - if <var>x</var> and <var>y</var> do not have the same length.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.8</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="fit(java.lang.Iterable)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>fit</h4> |
| <pre class="methodSignature">public double fit​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Iterable</a><? extends <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/geometry/DirectPosition.html?is-external=true" title="class or interface in org.opengis.geometry" class="externalLink">DirectPosition</a>> points)</pre> |
| <div class="block">Given a sequence of points, fits them to a straight line |
| <var>y</var> = <var>slope</var>⋅<var>x</var> + <var>y₀</var> in a least-squares senses. |
| Points shall be two dimensional with coordinate values in the (<var>x</var>,<var>y</var>) order. |
| This method assumes that the <var>x</var> values are precise and all uncertainty is in <var>y</var>. |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#NaN" title="class or interface in java.lang" class="externalLink"><code>Double.NaN</code></a> coordinate values are ignored.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>points</code> - the two-dimensional points.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>estimation of the correlation coefficient. The closer this coefficient is to +1 or -1, the better the fit.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/geometry/MismatchedDimensionException.html?is-external=true" title="class or interface in org.opengis.geometry" class="externalLink">MismatchedDimensionException</a></code> - if a point is not two-dimensional.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="clone()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>clone</h4> |
| <pre class="methodSignature">public <a href="Line.html" title="class in org.apache.sis.math">Line</a> clone()</pre> |
| <div class="block">Returns a clone of this line.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a clone of this line.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="equals(java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>equals</h4> |
| <pre class="methodSignature">public boolean equals​(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> object)</pre> |
| <div class="block">Compares this line with the specified object for equality.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>object</code> - the object to compare with this line for equality.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if both objects are equal.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="hashCode()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hashCode</h4> |
| <pre class="methodSignature">public int hashCode()</pre> |
| <div class="block">Returns a hash code value for this line.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toString()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre class="methodSignature">public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> toString()</pre> |
| <div class="block">Returns a string representation of this line. This method returns the linear equation |
| in the form <var>y</var> = <var>slope</var>⋅<var>x</var> + <var>y₀</var>.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a string representation of this line.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/Line.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2010–2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |