blob: d72fba91cc9ad288659c37647211acd5736a2220 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (19) -->
<title>Matrices (Apache SIS 1.3 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.sis.referencing.operation.matrix, class: Matrices">
<meta name="generator" content="javadoc/ClassWriterImpl">
<meta name="keywords" content="org.apache.sis.referencing.operation.matrix.Matrices class">
<meta name="keywords" content="createIdentity()">
<meta name="keywords" content="createDiagonal()">
<meta name="keywords" content="createZero()">
<meta name="keywords" content="create()">
<meta name="keywords" content="createTransform()">
<meta name="keywords" content="createDimensionSelect()">
<meta name="keywords" content="createPassThrough()">
<meta name="keywords" content="createAffine()">
<meta name="keywords" content="resizeAffine()">
<meta name="keywords" content="forceUniformScale()">
<meta name="keywords" content="copy()">
<meta name="keywords" content="unmodifiable()">
<meta name="keywords" content="multiply()">
<meta name="keywords" content="inverse()">
<meta name="keywords" content="isAffine()">
<meta name="keywords" content="isTranslation()">
<meta name="keywords" content="isIdentity()">
<meta name="keywords" content="equals()">
<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="../../../../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../script-dir/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="../../../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var pathtoroot = "../../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span></button>
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/Matrices.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#class">Help</a></li>
</ul>
<ul class="sub-nav-list-small">
<li>
<p>Summary:</p>
<ul>
<li>Nested</li>
<li>Field</li>
<li>Constr</li>
<li><a href="#method-summary">Method</a></li>
</ul>
</li>
<li>
<p>Detail:</p>
<ul>
<li>Field</li>
<li>Constr</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</li>
</ul>
</div>
<div class="sub-nav">
<div id="navbar-sub-list">
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><a href="../../../../../../search.html">SEARCH</a>
<input type="text" id="search-input" disabled placeholder="Search">
<input type="reset" id="reset-button" disabled value="reset">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.sis.referencing.operation.matrix</a></div>
<h1 title="Class Matrices" class="title">Class Matrices</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
<div class="inheritance"><a href="../../../util/Static.html" title="class in org.apache.sis.util">Static</a>
<div class="inheritance">Matrices</div>
</div>
</div>
<section class="class-description" id="class-description">
<hr>
<div class="type-signature"><span class="modifiers">public final class </span><span class="element-name type-name-label">Matrices</span>
<span class="extends-implements">extends <a href="../../../util/Static.html" title="class in org.apache.sis.util">Static</a></span></div>
<div class="block"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link"><code>Matrix</code></a> factory methods and utilities.
This class provides the following methods:
<ul>
<li>Creating new matrices of arbitrary size:
<a href="#createIdentity(int)"><code>create­Identity</code></a>,
<a href="#createDiagonal(int,int)"><code>create­Diagonal</code></a>,
<a href="#createZero(int,int)"><code>create­Zero</code></a>,
<a href="#create(int,int,double%5B%5D)"><code>create</code></a>,
<a href="#copy(org.opengis.referencing.operation.Matrix)"><code>copy</code></a>.
</li>
<li>Creating new matrices for coordinate operation steps:
<a href="#createTransform(org.opengis.geometry.Envelope,org.opengis.referencing.cs.AxisDirection%5B%5D,org.opengis.geometry.Envelope,org.opengis.referencing.cs.AxisDirection%5B%5D)"><code>create­Transform</code></a>,
<a href="#createDimensionSelect(int,int%5B%5D)"><code>create­Dimension­Select</code></a>,
<a href="#createPassThrough(int,org.opengis.referencing.operation.Matrix,int)"><code>create­Pass­Through</code></a>.
</li>
<li>Information:
<a href="#isAffine(org.opengis.referencing.operation.Matrix)"><code>is­Affine</code></a>,
<a href="#isIdentity(org.opengis.referencing.operation.Matrix,double)"><code>is­Identity</code></a>,
<a href="#equals(org.opengis.referencing.operation.Matrix,org.opengis.referencing.operation.Matrix,double,boolean)"><code>equals</code></a>,
<a href="#toString(org.opengis.referencing.operation.Matrix)"><code>to­String</code></a>.
</li>
<li>Miscellaneous:
<a href="#multiply(org.opengis.referencing.operation.Matrix,org.opengis.referencing.operation.Matrix)"><code>multiply</code></a>,
<a href="#inverse(org.opengis.referencing.operation.Matrix)"><code>inverse</code></a>,
<a href="#unmodifiable(org.opengis.referencing.operation.Matrix)"><code>unmodifiable</code></a>,
</li>
</ul></div>
<dl class="notes">
<dt>Since:</dt>
<dd>0.4</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="../../../parameter/TensorParameters.html" title="class in org.apache.sis.parameter"><code>Tensor­Parameters</code></a></li>
</ul>
</dd>
<p><font size="-1">Defined in the <code>sis-referencing</code> module</font></p>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#copy(org.opengis.referencing.operation.Matrix)" class="member-name-link">copy</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a new matrix which is a copy of the given matrix.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#create(int,int,double%5B%5D)" class="member-name-link">create</a><wbr>(int&nbsp;num­Row,
int&nbsp;num­Col,
double[]&nbsp;elements)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a matrix of size <code>num­Row</code> × <code>num­Col</code> initialized to the given elements.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#create(int,int,java.lang.Number%5B%5D)" class="member-name-link">create</a><wbr>(int&nbsp;num­Row,
int&nbsp;num­Col,
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>[]&nbsp;elements)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a matrix of size <code>num­Row</code> × <code>num­Col</code> initialized to the given numbers.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#createAffine(org.opengis.referencing.operation.Matrix,org.opengis.geometry.DirectPosition)" class="member-name-link">create­Affine</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;derivative,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/DirectPosition.html" title="class or interface in org.opengis.geometry" class="external-link">Direct­Position</a>&nbsp;translation)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates an affine transform as the given matrix augmented by the given translation vector and a [0 … 0 1] row.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#createDiagonal(int,int)" class="member-name-link">create­Diagonal</a><wbr>(int&nbsp;num­Row,
int&nbsp;num­Col)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a matrix of size <code>num­Row</code> × <code>num­Col</code>.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#createDimensionSelect(int,int%5B%5D)" class="member-name-link">create­Dimension­Select</a><wbr>(int&nbsp;source­Dimensions,
int[]&nbsp;selected­Dimensions)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a matrix for a transform that keep only a subset of source coordinate values.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#createIdentity(int)" class="member-name-link">create­Identity</a><wbr>(int&nbsp;size)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a square identity matrix of size <code>size</code> × <code>size</code>.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#createPassThrough(int,org.opengis.referencing.operation.Matrix,int)" class="member-name-link">create­Pass­Through</a><wbr>(int&nbsp;first­Affected­Coordinate,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;sub­Matrix,
int&nbsp;num­Trailing­Coordinates)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a matrix which converts a subset of coordinates using the transform given by another matrix.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#createTransform(org.opengis.geometry.Envelope,org.opengis.geometry.Envelope)" class="member-name-link">create­Transform</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html" title="class or interface in org.opengis.geometry" class="external-link">Envelope</a>&nbsp;src­Envelope,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html" title="class or interface in org.opengis.geometry" class="external-link">Envelope</a>&nbsp;dst­Envelope)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a transform matrix mapping the given source envelope to the given destination envelope.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#createTransform(org.opengis.geometry.Envelope,org.opengis.referencing.cs.AxisDirection%5B%5D,org.opengis.geometry.Envelope,org.opengis.referencing.cs.AxisDirection%5B%5D)" class="member-name-link">create­Transform</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html" title="class or interface in org.opengis.geometry" class="external-link">Envelope</a>&nbsp;src­Envelope,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/cs/AxisDirection.html" title="class or interface in org.opengis.referencing.cs" class="external-link">Axis­Direction</a>[]&nbsp;src­Axes,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html" title="class or interface in org.opengis.geometry" class="external-link">Envelope</a>&nbsp;dst­Envelope,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/cs/AxisDirection.html" title="class or interface in org.opengis.referencing.cs" class="external-link">Axis­Direction</a>[]&nbsp;dst­Axes)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a transform matrix mapping the given source envelope to the given destination envelope,
combined with changes in axis order and/or direction.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#createTransform(org.opengis.referencing.cs.AxisDirection%5B%5D,org.opengis.referencing.cs.AxisDirection%5B%5D)" class="member-name-link">create­Transform</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/cs/AxisDirection.html" title="class or interface in org.opengis.referencing.cs" class="external-link">Axis­Direction</a>[]&nbsp;src­Axes,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/cs/AxisDirection.html" title="class or interface in org.opengis.referencing.cs" class="external-link">Axis­Direction</a>[]&nbsp;dst­Axes)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a transform matrix changing axis order and/or direction.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#createZero(int,int)" class="member-name-link">create­Zero</a><wbr>(int&nbsp;num­Row,
int&nbsp;num­Col)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a matrix of size <code>num­Row</code> × <code>num­Col</code> filled with zero values.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#equals(org.opengis.referencing.operation.Matrix,org.opengis.referencing.operation.Matrix,double,boolean)" class="member-name-link">equals</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;m1,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;m2,
double&nbsp;epsilon,
boolean&nbsp;relative)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Compares the given matrices for equality, using the given relative or absolute tolerance threshold.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#equals(org.opengis.referencing.operation.Matrix,org.opengis.referencing.operation.Matrix,org.apache.sis.util.ComparisonMode)" class="member-name-link">equals</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;m1,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;m2,
<a href="../../../util/ComparisonMode.html" title="enum class in org.apache.sis.util">Comparison­Mode</a>&nbsp;mode)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Compares the given matrices for equality, using the given comparison strictness level.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#forceUniformScale(org.opengis.referencing.operation.Matrix,double,double%5B%5D)" class="member-name-link">force­Uniform­Scale</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix,
double&nbsp;selector,
double[]&nbsp;anchor)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Forces the matrix coefficients of the given matrix to a uniform scale factor, assuming an affine transform.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#inverse(org.opengis.referencing.operation.Matrix)" class="member-name-link">inverse</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the inverse of the given matrix.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#isAffine(org.opengis.referencing.operation.Matrix)" class="member-name-link">is­Affine</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if the given matrix represents an affine transform.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#isIdentity(org.opengis.referencing.operation.Matrix,double)" class="member-name-link">is­Identity</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix,
double&nbsp;tolerance)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if the given matrix is close to an identity matrix, given a tolerance threshold.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#isTranslation(org.opengis.referencing.operation.Matrix)" class="member-name-link">is­Translation</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if the given matrix represents a translation.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#multiply(org.opengis.referencing.operation.Matrix,org.opengis.referencing.operation.Matrix)" class="member-name-link">multiply</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;m1,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;m2)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns a new matrix which is the result of multiplying the first matrix with the second one.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#resizeAffine(org.opengis.referencing.operation.Matrix,int,int)" class="member-name-link">resize­Affine</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix,
int&nbsp;num­Row,
int&nbsp;num­Col)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns a matrix with the same content than the given matrix but a different size, assuming an affine transform.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#toString(org.opengis.referencing.operation.Matrix)" class="member-name-link">to­String</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns a unlocalized string representation of the given matrix.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">Matrix­SIS</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#unmodifiable(org.opengis.referencing.operation.Matrix)" class="member-name-link">unmodifiable</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns an unmodifiable view of the given matrix.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-Object">Methods inherited from class&nbsp;<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">get­Class</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hash­Code</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notify­All</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">to­String</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="createIdentity(int)">
<h3>createIdentity</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">createIdentity</span><wbr><span class="parameters">(int&nbsp;size)</span></div>
<div class="block">Creates a square identity matrix of size <code>size</code> × <code>size</code>.
Elements on the diagonal (<var>j</var> == <var>i</var>) are set to 1.
<div class="note"><b>Implementation note:</b>
For sizes between <a href="Matrix1.html#SIZE">1</a> and
<a href="Matrix4.html#SIZE">4</a> inclusive, the matrix
is guaranteed to be an instance of one of <a href="Matrix1.html" title="class in org.apache.sis.referencing.operation.matrix"><code>Matrix1</code></a><a href="Matrix4.html" title="class in org.apache.sis.referencing.operation.matrix"><code>Matrix4</code></a> subtypes.</div></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>size</code> - numbers of row and columns. For an affine transform matrix, this is the number of
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html#getSourceDimensions()" title="class or interface in org.opengis.referencing.operation" class="external-link">source</a> and
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html#getTargetDimensions()" title="class or interface in org.opengis.referencing.operation" class="external-link">target</a> dimensions + 1.</dd>
<dt>Returns:</dt>
<dd>an identity matrix of the given size.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="createDiagonal(int,int)">
<h3>createDiagonal</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">createDiagonal</span><wbr><span class="parameters">(int&nbsp;numRow,
int&nbsp;numCol)</span></div>
<div class="block">Creates a matrix of size <code>num­Row</code> × <code>num­Col</code>.
Elements on the diagonal (<var>j</var> == <var>i</var>) are set to 1.
The result is an identity matrix if <code>num­Row</code> = <code>num­Col</code>.
<div class="note"><b>Implementation note:</b>
For <code>num­Row</code> == <code>num­Col</code> with a value between
<a href="Matrix1.html#SIZE">1</a> and
<a href="Matrix4.html#SIZE">4</a> inclusive, the matrix
is guaranteed to be an instance of one of <a href="Matrix1.html" title="class in org.apache.sis.referencing.operation.matrix"><code>Matrix1</code></a><a href="Matrix4.html" title="class in org.apache.sis.referencing.operation.matrix"><code>Matrix4</code></a> subtypes.</div></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>num­Row</code> - for a math transform, this is the number of <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html#getTargetDimensions()" title="class or interface in org.opengis.referencing.operation" class="external-link">target dimensions</a> + 1.</dd>
<dd><code>num­Col</code> - for a math transform, this is the number of <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html#getSourceDimensions()" title="class or interface in org.opengis.referencing.operation" class="external-link">source dimensions</a> + 1.</dd>
<dt>Returns:</dt>
<dd>an identity matrix of the given size.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="createZero(int,int)">
<h3>createZero</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">createZero</span><wbr><span class="parameters">(int&nbsp;numRow,
int&nbsp;numCol)</span></div>
<div class="block">Creates a matrix of size <code>num­Row</code> × <code>num­Col</code> filled with zero values.
This constructor is convenient when the caller wants to initialize the matrix elements himself.
<div class="note"><b>Implementation note:</b>
For <code>num­Row</code> == <code>num­Col</code> with a value between
<a href="Matrix1.html#SIZE">1</a> and
<a href="Matrix4.html#SIZE">4</a> inclusive, the matrix
is guaranteed to be an instance of one of <a href="Matrix1.html" title="class in org.apache.sis.referencing.operation.matrix"><code>Matrix1</code></a><a href="Matrix4.html" title="class in org.apache.sis.referencing.operation.matrix"><code>Matrix4</code></a> subtypes.</div></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>num­Row</code> - for a math transform, this is the number of <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html#getTargetDimensions()" title="class or interface in org.opengis.referencing.operation" class="external-link">target dimensions</a> + 1.</dd>
<dd><code>num­Col</code> - for a math transform, this is the number of <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html#getSourceDimensions()" title="class or interface in org.opengis.referencing.operation" class="external-link">source dimensions</a> + 1.</dd>
<dt>Returns:</dt>
<dd>a matrix of the given size with only zero values.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="create(int,int,double[])">
<h3>create</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">create</span><wbr><span class="parameters">(int&nbsp;numRow,
int&nbsp;numCol,
double[]&nbsp;elements)</span></div>
<div class="block">Creates a matrix of size <code>num­Row</code> × <code>num­Col</code> initialized to the given elements.
The elements array size must be equal to <code>num­Row*num­Col</code>. Column indices vary fastest.
<div class="note"><b>Implementation note:</b>
For <code>num­Row</code> == <code>num­Col</code> with a value between
<a href="Matrix1.html#SIZE">1</a> and
<a href="Matrix4.html#SIZE">4</a> inclusive, the matrix
is guaranteed to be an instance of one of <a href="Matrix1.html" title="class in org.apache.sis.referencing.operation.matrix"><code>Matrix1</code></a><a href="Matrix4.html" title="class in org.apache.sis.referencing.operation.matrix"><code>Matrix4</code></a> subtypes.</div></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>num­Row</code> - number of rows.</dd>
<dd><code>num­Col</code> - number of columns.</dd>
<dd><code>elements</code> - the matrix elements in a row-major array. Column indices vary fastest.</dd>
<dt>Returns:</dt>
<dd>a matrix initialized to the given elements.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="MatrixSIS.html#setElements(double%5B%5D)"><code>Matrix­SIS​.set­Elements(double[])</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="create(int,int,java.lang.Number[])">
<h3>create</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">create</span><wbr><span class="parameters">(int&nbsp;numRow,
int&nbsp;numCol,
<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Number.html" title="class or interface in java.lang" class="external-link">Number</a>[]&nbsp;elements)</span></div>
<div class="block">Creates a matrix of size <code>num­Row</code> × <code>num­Col</code> initialized to the given numbers.
The elements array size must be equal to <code>num­Row*num­Col</code>. Column indices vary fastest.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>num­Row</code> - number of rows.</dd>
<dd><code>num­Col</code> - number of columns.</dd>
<dd><code>elements</code> - the matrix elements in a row-major array. Column indices vary fastest.</dd>
<dt>Returns:</dt>
<dd>a matrix initialized to the given elements.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="createTransform(org.opengis.geometry.Envelope,org.opengis.geometry.Envelope)">
<h3>createTransform</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">createTransform</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html" title="class or interface in org.opengis.geometry" class="external-link">Envelope</a>&nbsp;srcEnvelope,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html" title="class or interface in org.opengis.geometry" class="external-link">Envelope</a>&nbsp;dstEnvelope)</span></div>
<div class="block">Creates a transform matrix mapping the given source envelope to the given destination envelope.
The given envelopes can have any dimensions, which are handled as below:
<ul>
<li>If the two envelopes have the same <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html#getDimension()" title="class or interface in org.opengis.geometry" class="external-link">dimension</a>,
then the transform is <a href="#isAffine(org.opengis.referencing.operation.Matrix)">affine</a>.</li>
<li>If the destination envelope has less dimensions than the source envelope,
then trailing dimensions are silently dropped.</li>
<li>If the target envelope has more dimensions than the source envelope,
then the transform will append trailing coordinates with the 0 value.</li>
</ul>
This method ignores the <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html#getCoordinateReferenceSystem()" title="class or interface in org.opengis.geometry" class="external-link">envelope CRS</a>, which may be null.
Actually this method is used more often for grid envelopes
(which have no CRS) than geodetic envelopes.
<h4>Crossing the anti-meridian of a Geographic CRS</h4>
If the given envelopes cross the date line, then this method requires their <code>get­Span(int)</code> method
to behave as documented in the <a href="../../../geometry/AbstractEnvelope.html#getSpan(int)"><code>Abstract­Envelope​.get­Span(int)</code></a> javadoc.
Furthermore, the matrix created by this method will produce expected results only for source or destination
points before the date line, since the wrap around operation cannot be represented by an affine transform.
<h4>Example</h4>
Given a source envelope of size 100 × 200 (the units do not matter for this method) and a destination
envelope of size 300 × 500, and given <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html#getLowerCorner()" title="class or interface in org.opengis.geometry" class="external-link">lower corner</a> translation
from (-20, -40) to (-10, -25), then the following method call:
<blockquote><pre>matrix = Matrices.<b>createTransform</b>(
<font color="green">new</font> <b>Envelope2D</b>(<font color="green">null</font>, -20, -40, 100, 200),
<font color="green">new</font> <b>Envelope2D</b>(<font color="green">null</font>, -10, -25, 300, 500));</pre></blockquote>
will return the following square matrix. The transform of the lower corner is given as an example:
<blockquote><pre>┌ ┐ ┌ ┐ ┌ ┐
│ -10 │ │ 3.0 0 50 │ │ -20 │ // 3.0 is the scale factor from width of 100 to 300
│ -25 │ = │ 0 2.5 75 │ × │ -40 │ // 2.5 is the scale factor from height of 200 to 500
│ 1 │ │ 0 0 1 │ │ 1 │
└ ┘ └ ┘ └ ┘</pre></blockquote></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>src­Envelope</code> - the source envelope.</dd>
<dd><code>dst­Envelope</code> - the destination envelope.</dd>
<dt>Returns:</dt>
<dd>the transform from the given source envelope to target envelope.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="#createTransform(org.opengis.referencing.cs.AxisDirection%5B%5D,org.opengis.referencing.cs.AxisDirection%5B%5D)"><code>create­Transform(Axis­Direction[], Axis­Direction[])</code></a></li>
<li><a href="#createTransform(org.opengis.geometry.Envelope,org.opengis.referencing.cs.AxisDirection%5B%5D,org.opengis.geometry.Envelope,org.opengis.referencing.cs.AxisDirection%5B%5D)"><code>create­Transform(Envelope, Axis­Direction[], Envelope, Axis­Direction[])</code></a></li>
<li><a href="../../cs/CoordinateSystems.html#swapAndScaleAxes(org.opengis.referencing.cs.CoordinateSystem,org.opengis.referencing.cs.CoordinateSystem)"><code>Coordinate­Systems​.swap­And­Scale­Axes(Coordinate­System, Coordinate­System)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="createTransform(org.opengis.referencing.cs.AxisDirection[],org.opengis.referencing.cs.AxisDirection[])">
<h3>createTransform</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">createTransform</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/cs/AxisDirection.html" title="class or interface in org.opengis.referencing.cs" class="external-link">AxisDirection</a>[]&nbsp;srcAxes,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/cs/AxisDirection.html" title="class or interface in org.opengis.referencing.cs" class="external-link">AxisDirection</a>[]&nbsp;dstAxes)</span></div>
<div class="block">Creates a transform matrix changing axis order and/or direction. For example, the transform may convert
(<i>northing</i>, <i>westing</i>) coordinates into (<i>easting</i>, <i>northing</i>) coordinates.
This method tries to associate each <code>dst­Axes</code> direction to either an equals <code>src­Axis</code>
direction, or to an opposite <code>src­Axis</code> direction.
<ul>
<li>If some <code>src­Axes</code> directions cannot be mapped to <code>dst­Axes</code> directions, then the transform
will silently drops the coordinates associated to those extra source axis directions.</li>
<li>If some <code>dst­Axes</code> directions cannot be mapped to <code>src­Axes</code> directions,
then an exception will be thrown.</li>
</ul>
<div class="note"><b>Example:</b>
it is legal to transform from (<i>easting</i>, <i>northing</i>, <i>up</i>) to
(<i>easting</i>, <i>northing</i>) — this is the first above case — but illegal
to transform (<i>easting</i>, <i>northing</i>) to (<i>easting</i>, <i>up</i>).</div>
<h4>Example</h4>
The following method call:
<blockquote><pre>matrix = Matrices.<b>createTransform</b>(
<font color="green">new</font> AxisDirection[] {AxisDirection.NORTH, AxisDirection.WEST},
<font color="green">new</font> AxisDirection[] {AxisDirection.EAST, AxisDirection.NORTH});</pre></blockquote>
will return the following square matrix, which can be used in coordinate conversions as below:
<blockquote><pre>┌ ┐ ┌ ┐ ┌ ┐
│ +<var>x</var> │ │ 0 -1 0 │ │ <var>y</var>
<var>y</var> │ = │ 1 0 0 │ × │ -<var>x</var>
│ 1 │ │ 0 0 1 │ │ 1 │
└ ┘ └ ┘ └ ┘</pre></blockquote></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>src­Axes</code> - the ordered sequence of axis directions for source coordinate system.</dd>
<dd><code>dst­Axes</code> - the ordered sequence of axis directions for destination coordinate system.</dd>
<dt>Returns:</dt>
<dd>the transform from the given source axis directions to the given target axis directions.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if <code>dst­Axes</code> contains at least one axis not found in <code>src­Axes</code>,
or if some colinear axes were found.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="#createTransform(org.opengis.geometry.Envelope,org.opengis.geometry.Envelope)"><code>create­Transform(Envelope, Envelope)</code></a></li>
<li><a href="#createTransform(org.opengis.geometry.Envelope,org.opengis.referencing.cs.AxisDirection%5B%5D,org.opengis.geometry.Envelope,org.opengis.referencing.cs.AxisDirection%5B%5D)"><code>create­Transform(Envelope, Axis­Direction[], Envelope, Axis­Direction[])</code></a></li>
<li><a href="../../cs/CoordinateSystems.html#swapAndScaleAxes(org.opengis.referencing.cs.CoordinateSystem,org.opengis.referencing.cs.CoordinateSystem)"><code>Coordinate­Systems​.swap­And­Scale­Axes(Coordinate­System, Coordinate­System)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="createTransform(org.opengis.geometry.Envelope,org.opengis.referencing.cs.AxisDirection[],org.opengis.geometry.Envelope,org.opengis.referencing.cs.AxisDirection[])">
<h3>createTransform</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">createTransform</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html" title="class or interface in org.opengis.geometry" class="external-link">Envelope</a>&nbsp;srcEnvelope,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/cs/AxisDirection.html" title="class or interface in org.opengis.referencing.cs" class="external-link">AxisDirection</a>[]&nbsp;srcAxes,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html" title="class or interface in org.opengis.geometry" class="external-link">Envelope</a>&nbsp;dstEnvelope,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/cs/AxisDirection.html" title="class or interface in org.opengis.referencing.cs" class="external-link">AxisDirection</a>[]&nbsp;dstAxes)</span></div>
<div class="block">Creates a transform matrix mapping the given source envelope to the given destination envelope,
combined with changes in axis order and/or direction.
Invoking this method is equivalent to concatenating the following matrix transforms:
<ul>
<li><code><a href="#createTransform(org.opengis.geometry.Envelope,org.opengis.geometry.Envelope)">create­Transform</a>(src­Envelope, dst­Envelope)</code></li>
<li><code><a href="#createTransform(org.opengis.referencing.cs.AxisDirection%5B%5D,org.opengis.referencing.cs.AxisDirection%5B%5D)">create­Transform</a>(src­Axes, dst­Axes)</code></li>
</ul>
This method ignores the <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html#getCoordinateReferenceSystem()" title="class or interface in org.opengis.geometry" class="external-link">envelope CRS</a>, which may be null.
Actually this method is used more often for grid envelopes
(which have no CRS) than geodetic envelopes.
<h4>Crossing the anti-meridian of a Geographic CRS</h4>
If the given envelopes cross the date line, then this method requires their <code>get­Span(int)</code> method
to behave as documented in the <a href="../../../geometry/AbstractEnvelope.html#getSpan(int)"><code>Abstract­Envelope​.get­Span(int)</code></a> javadoc.
Furthermore, the matrix created by this method will produce expected results only for source or destination
points on one side of the date line (depending on whether axis direction is reversed), since the wrap around
operation cannot be represented by an affine transform.
<div class="note"><b>Example:</b>
combining the examples documented in the above <code>create­Transform(…)</code> methods, the following method call:
<blockquote><pre>matrix = Matrices.<b>createTransform</b>(
<font color="green">new</font> <b>Envelope2D</b>(<font color="green">null</font>, -40, +20, 200, 100), <font color="green">new</font> AxisDirection[] {AxisDirection.NORTH, AxisDirection.WEST},
<font color="green">new</font> <b>Envelope2D</b>(<font color="green">null</font>, -10, -25, 300, 500), <font color="green">new</font> AxisDirection[] {AxisDirection.EAST, AxisDirection.NORTH});</pre></blockquote>
will return the following square matrix. The transform of a corner is given as an example.
Note that the input coordinate values are swapped because of the (<i>North</i>, <i>West</i>) axis directions,
and the lower-left corner of the destination envelope is the lower-<em>right</em> corner of the source envelope
because of the opposite axis direction.
<blockquote><pre>┌ ┐ ┌ ┐ ┌ ┐
│ -10 │ │ 0 -3.0 350 │ │ -40 │
│ -25 │ = │ 2.5 0 75 │ × │ 120 │ // 120 is the westernmost source coordinate: (<var>x</var>=20) + (width=100)
│ 1 │ │ 0 0 1 │ │ 1 │
└ ┘ └ ┘ └ ┘</pre></blockquote>
</div></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>src­Envelope</code> - the source envelope.</dd>
<dd><code>src­Axes</code> - the ordered sequence of axis directions for source coordinate system.</dd>
<dd><code>dst­Envelope</code> - the destination envelope.</dd>
<dd><code>dst­Axes</code> - the ordered sequence of axis directions for destination coordinate system.</dd>
<dt>Returns:</dt>
<dd>the transform from the given source envelope and axis directions
to the given envelope and target axis directions.</dd>
<dt>Throws:</dt>
<dd><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/MismatchedDimensionException.html" title="class or interface in org.opengis.geometry" class="external-link">Mismatched­Dimension­Exception</a></code> - if an envelope <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html#getDimension()" title="class or interface in org.opengis.geometry" class="external-link">dimension</a> does not
match the length of the axis directions sequence.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if <code>dst­Axes</code> contains at least one axis not found in <code>src­Axes</code>,
or if some colinear axes were found.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="#createTransform(org.opengis.geometry.Envelope,org.opengis.geometry.Envelope)"><code>create­Transform(Envelope, Envelope)</code></a></li>
<li><a href="#createTransform(org.opengis.referencing.cs.AxisDirection%5B%5D,org.opengis.referencing.cs.AxisDirection%5B%5D)"><code>create­Transform(Axis­Direction[], Axis­Direction[])</code></a></li>
<li><a href="../../cs/CoordinateSystems.html#swapAndScaleAxes(org.opengis.referencing.cs.CoordinateSystem,org.opengis.referencing.cs.CoordinateSystem)"><code>Coordinate­Systems​.swap­And­Scale­Axes(Coordinate­System, Coordinate­System)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="createDimensionSelect(int,int[])">
<h3>createDimensionSelect</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">createDimensionSelect</span><wbr><span class="parameters">(int&nbsp;sourceDimensions,
int[]&nbsp;selectedDimensions)</span></div>
<div class="block">Creates a matrix for a transform that keep only a subset of source coordinate values.
The matrix size will be (<code>selected­Dimensions​.length</code> + 1) × (<code>source­Dimensions</code> + 1).
The matrix will contain only zero elements, except for the following cells which will contain 1:
<ul>
<li>The last column in the last row.</li>
<li>For any row <var>j</var> other than the last row, the column <code>selected­Dimensions[j]</code>.</li>
</ul>
<div class="note"><b>Example:</b>
given (<var>x</var>,<var>y</var>,<var>z</var>,<var>t</var>) coordinate values, if one wants to keep
(<var>y</var>,<var>x</var>,<var>t</var>) coordinates (note the <var>x</var><var>y</var> swapping)
and discard the <var>z</var> values, then the indices of source coordinates to select are 1 for <var>y</var>,
0 for <var>x</var> and 3 for <var>t</var>. One can use the following method call:
<blockquote><pre>matrix = Matrices.<b>createDimensionSelect</b>(4, <font color="green">new</font> <font color="green">int</font>[] {1, 0, 3});</pre></blockquote>
The above method call will create the following 4×5 matrix,
which can be used for converting coordinates as below:
<blockquote><pre>┌ ┐ ┌ ┐ ┌ ┐
<var>y</var> │ │ 0 1 0 0 0 │ │ <var>x</var>
<var>x</var> │ │ 1 0 0 0 0 │ │ <var>y</var>
<var>t</var> │ = │ 0 0 0 1 0 │ × │ <var>z</var>
│ 1 │ │ 0 0 0 0 1 │ │ <var>t</var>
└ ┘ └ ┘ │ 1 │
└ ┘</pre></blockquote>
</div>
The inverse of the matrix created by this method will put <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#NaN" title="class or interface in java.lang" class="external-link"><code>Double​.Na­N</code></a> values in the extra dimensions.
Other dimensions will work as expected.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>source­Dimensions</code> - the number of dimensions in source coordinates.</dd>
<dd><code>selected­Dimensions</code> - the 0-based indices of source coordinate values to keep.
The length of this array will be the number of dimensions in target coordinates.</dd>
<dt>Returns:</dt>
<dd>an affine transform matrix keeping only the given source dimensions, and discarding all others.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if a value of <code>selected­Dimensions</code> is lower than 0
or not smaller than <code>source­Dimensions</code>.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="../transform/TransformSeparator.html" title="class in org.apache.sis.referencing.operation.transform"><code>Transform­Separator</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="createPassThrough(int,org.opengis.referencing.operation.Matrix,int)">
<h3>createPassThrough</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">createPassThrough</span><wbr><span class="parameters">(int&nbsp;firstAffectedCoordinate,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;subMatrix,
int&nbsp;numTrailingCoordinates)</span></div>
<div class="block">Creates a matrix which converts a subset of coordinates using the transform given by another matrix.
For example, giving (<var>latitude</var>, <var>longitude</var>, <var>height</var>) coordinates,
a pass through operation can convert the height values from feet to metres without affecting
the (<var>latitude</var>, <var>longitude</var>) values.
<p>The given sub-matrix shall have the following properties:</p>
<ul>
<li>The last row often (but not necessarily) contains 0 values everywhere except in the last column.</li>
<li>Values in the last column are translation terms, except in the last row.</li>
<li>All other values are scale or shear terms.</li>
</ul>
A square matrix complying with the above conditions is often <a href="#isAffine(org.opengis.referencing.operation.Matrix)">affine</a>,
but this is not mandatory
(for example a <cite>perspective transform</cite> may contain non-zero values in the last row).
<p>This method builds a new matrix with the following content:</p>
<ul>
<li>An amount of <code>first­Affected­Coordinate</code> rows and columns are inserted before the first
row and columns of the sub-matrix. The elements for the new rows and columns are set to 1
on the diagonal, and 0 elsewhere.</li>
<li>The sub-matrix - except for its last row and column - is copied in the new matrix starting
at index (<code>first­Affected­Coordinate</code>, <code>first­Affected­Coordinate</code>).</li>
<li>An amount of <code>num­Trailing­Coordinates</code> rows and columns are appended after the above sub-matrix.
Their elements are set to 1 on the pseudo-diagonal ending in the lower-right corner, and 0 elsewhere.</li>
<li>The last sub-matrix row is copied in the last row of the new matrix, and the last sub-matrix column
is copied in the last column of the sub-matrix.</li>
</ul>
<div class="note"><b>Example:</b>
given the following sub-matrix which converts height values from feet to metres before to subtracts 25 metres:
<blockquote><pre>┌ ┐ ┌ ┐ ┌ ┐
<var>z</var>' │ = │ 0.3048 -25 │ × │ <var>z</var>
│ 1 │ │ 0 1 │ │ 1 │
└ ┘ └ ┘ └ ┘</pre></blockquote>
Then a call to <code>Matrices​.create­Pass­Through(2, sub­Matrix, 1)</code> will return the following matrix,
which can be used for converting the height (<var>z</var>) without affecting the other coordinate values
(<var>x</var>,<var>y</var>,<var>t</var>):
<blockquote><pre>┌ ┐ ┌ ┐ ┌ ┐
<var>x</var> │ │ 1 0 0 0 0 │ │ <var>x</var>
<var>y</var> │ │ 0 1 0 0 0 │ │ <var>y</var>
<var>z</var>' │ = │ 0 0 0.3048 0 -25 │ × │ <var>z</var>
<var>t</var> │ │ 0 0 0 1 0 │ │ <var>t</var>
│ 1 │ │ 0 0 0 0 1 │ │ 1 │
└ ┘ └ ┘ └ ┘</pre></blockquote>
</div></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>first­Affected­Coordinate</code> - the lowest index of the affected coordinates.</dd>
<dd><code>sub­Matrix</code> - the matrix to use for affected coordinates.</dd>
<dd><code>num­Trailing­Coordinates</code> - number of trailing coordinates to pass through.</dd>
<dt>Returns:</dt>
<dd>a matrix for the same transform than the given matrix,
augmented with leading and trailing pass-through coordinates.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="../transform/DefaultMathTransformFactory.html#createPassThroughTransform(int,org.opengis.referencing.operation.MathTransform,int)"><code>Default­Math­Transform­Factory​.create­Pass­Through­Transform(int, Math­Transform, int)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="createAffine(org.opengis.referencing.operation.Matrix,org.opengis.geometry.DirectPosition)">
<h3>createAffine</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">createAffine</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;derivative,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/DirectPosition.html" title="class or interface in org.opengis.geometry" class="external-link">DirectPosition</a>&nbsp;translation)</span></div>
<div class="block">Creates an affine transform as the given matrix augmented by the given translation vector and a [0 … 0 1] row.
At least one of <code>derivative</code> and <code>translation</code> arguments shall be non-null. If <code>derivative</code>
is non-null, the returned matrix will have one more row and one more column than <code>derivative</code> with all
<code>derivative</code> values copied into the new matrix at the same (row, column) indices. If <code>translation</code>
is non-null, all its coordinate values are copied in the last column of the returned matrix.
<div class="note"><b>Relationship with <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html" title="class or interface in org.opengis.referencing.operation" class="external-link"><code>Math­Transform</code></a></b><br>
When used together with <a href="../transform/MathTransforms.html#derivativeAndTransform(org.opengis.referencing.operation.MathTransform,double%5B%5D,int,double%5B%5D,int)"><code>Math­Transforms​.derivative­And­Transform(…)</code></a>,
the <code>derivative</code> argument is the derivative computed by <code>derivative­And­Transform(…)</code> and the
<code>translation</code> vector is the position computed by that method. The result is an approximation of the
transform in the vicinity of the position given to <code>derivative­And­Transform(…)</code>.</div></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>derivative</code> - the scale, shear and rotation of the affine transform.</dd>
<dd><code>translation</code> - the translation vector (the last column) of the affine transform.</dd>
<dt>Returns:</dt>
<dd>an affine transform as the given matrix augmented by the given column and a a [0 … 0 1] row.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">Null­Pointer­Exception</a></code> - if <code>derivative</code> and <code>translation</code> are both null.</dd>
<dd><code><a href="MismatchedMatrixSizeException.html" title="class in org.apache.sis.referencing.operation.matrix">Mismatched­Matrix­Size­Exception</a></code> - if <code>derivative</code> and <code>translation</code> are both non-null and
the number of <code>derivative</code> rows is not equal to the number of <code>translation</code> dimensions.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="../transform/MathTransforms.html#derivativeAndTransform(org.opengis.referencing.operation.MathTransform,double%5B%5D,int,double%5B%5D,int)"><code>Math­Transforms​.derivative­And­Transform(Math­Transform, double[], int, double[], int)</code></a></li>
<li><a href="../transform/MathTransforms.html#tangent(org.opengis.referencing.operation.MathTransform,org.opengis.geometry.DirectPosition)"><code>Math­Transforms​.tangent(Math­Transform, Direct­Position)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="resizeAffine(org.opengis.referencing.operation.Matrix,int,int)">
<h3>resizeAffine</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a></span>&nbsp;<span class="element-name">resizeAffine</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix,
int&nbsp;numRow,
int&nbsp;numCol)</span></div>
<div class="block">Returns a matrix with the same content than the given matrix but a different size, assuming an affine transform.
This method can be invoked for adding or removing the <strong>last</strong> dimensions of an affine transform.
More specifically:
<ul class="verbose">
<li>If the given <code>num­Col</code> is <var>n</var> less than the number of columns in the given matrix,
then the <var>n</var> columns <em>before the last column</em> are removed.
The last column is left unchanged because it is assumed to contain the translation terms.</li>
<li>If the given <code>num­Col</code> is <var>n</var> more than the number of columns in the given matrix,
then <var>n</var> columns are inserted <em>before the last column</em>.
All values in the new columns will be zero.</li>
<li>If the given <code>num­Row</code> is <var>n</var> less than the number of rows in the given matrix,
then the <var>n</var> rows <em>before the last row</em> are removed.
The last row is left unchanged because it is assumed to contain the usual [0 0 0 … 1] terms.</li>
<li>If the given <code>num­Row</code> is <var>n</var> more than the number of rows in the given matrix,
then <var>n</var> rows are inserted <em>before the last row</em>.
The corresponding offset and scale factors will be 0 and 1 respectively.
In other words, new dimensions are propagated unchanged.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>matrix</code> - the matrix to resize. This matrix will never be changed.</dd>
<dd><code>num­Row</code> - the new number of rows. This is equal to the desired number of target dimensions plus 1.</dd>
<dd><code>num­Col</code> - the new number of columns. This is equal to the desired number of source dimensions plus 1.</dd>
<dt>Returns:</dt>
<dd>a new matrix of the given size, or the given <code>matrix</code> if no resizing was needed.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="forceUniformScale(org.opengis.referencing.operation.Matrix,double,double[])">
<h3>forceUniformScale</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">forceUniformScale</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix,
double&nbsp;selector,
double[]&nbsp;anchor)</span></div>
<div class="block">Forces the matrix coefficients of the given matrix to a uniform scale factor, assuming an affine transform.
The uniformization is applied on a row-by-row basis (ignoring the last row and last column), i.e.:
<ul>
<li>All coefficients (excluding translation term) in the same row are multiplied by the same factor.</li>
<li>After rescaling, each row (excluding translation column) have the same
<a href="../../../math/MathFunctions.html#magnitude(double...)">magnitude</a>.</li>
</ul>
The coefficients are multiplied by factors which result in the smallest magnitude if <code>selector</code> is 0,
the largest magnitude if <code>selector</code> is 1, or an intermediate value if <code>selector</code> is any value
between 0 and 1. In the common case where the matrix has no rotation and no shear terms, the magnitude is
directly the scale factors on the matrix diagonal and <code>selector=0</code> sets all those scales to the smallest
value while <code>selector=1</code> sets all those scales to the largest value (ignoring sign).
<p>Translation terms can be compensated for scale changes if the <code>anchor</code> argument is non-null.
The anchor gives coordinates of the point to keep at fixed position in target coordinates.
For example if the matrix is for transforming coordinates to a screen device
and <code>target</code> is an <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html" title="class or interface in org.opengis.geometry" class="external-link"><code>Envelope</code></a> with device position and size in pixels, then:</p>
<ul>
<li><code>anchor[i] = target​.get­Minimum(i)</code> keeps the image on the left border (<var>i</var> = 0)
or upper border (<var>i</var> = 1).</li>
<li><code>anchor[i] = target​.get­Maximum(i)</code> translates the image to the right border (<var>i</var> = 0)
or to the bottom border (<var>i</var> = 1).</li>
<li><code>anchor[i] = target​.get­Median(i)</code> translates the image to the device center.</li>
<li>Any intermediate values are allowed.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>matrix</code> - the matrix in which to uniformize scale factors. Will be modified in-place.</dd>
<dd><code>selector</code> - a value between 0 for smallest scale magnitude and 1 for largest scale magnitude (inclusive).
Values outside [0 … 1] range are authorized, but will result in scale factors outside the
range of current scale factors in the given matrix.</dd>
<dd><code>anchor</code> - point to keep at fixed position in target coordinates, or <code>null</code> if none.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if the given matrix changed as a result of this method call.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="copy(org.opengis.referencing.operation.Matrix)">
<h3>copy</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">copy</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix)</span></div>
<div class="block">Creates a new matrix which is a copy of the given matrix.
<div class="note"><b>Implementation note:</b>
For square matrix with a size between <a href="Matrix1.html#SIZE">1</a>
and <a href="Matrix4.html#SIZE">4</a> inclusive, the returned matrix is
usually an instance of one of <a href="Matrix1.html" title="class in org.apache.sis.referencing.operation.matrix"><code>Matrix1</code></a><a href="Matrix4.html" title="class in org.apache.sis.referencing.operation.matrix"><code>Matrix4</code></a> subtypes.</div></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>matrix</code> - the matrix to copy, or <code>null</code>.</dd>
<dt>Returns:</dt>
<dd>a copy of the given matrix, or <code>null</code> if the given matrix was null.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="MatrixSIS.html#clone()"><code>Matrix­SIS​.clone()</code></a></li>
<li><a href="MatrixSIS.html#castOrCopy(org.opengis.referencing.operation.Matrix)"><code>Matrix­SIS​.cast­Or­Copy(Matrix)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="unmodifiable(org.opengis.referencing.operation.Matrix)">
<h3>unmodifiable</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">unmodifiable</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix)</span></div>
<div class="block">Returns an unmodifiable view of the given matrix. The returned matrix is immutable
only if the given <code>matrix</code> is not modified anymore after this method call.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>matrix</code> - the matrix for which to get an unmodifiable view, or <code>null</code>.</dd>
<dt>Returns:</dt>
<dd>a unmodifiable view of the given matrix, or <code>null</code> if the given matrix was null.</dd>
<dt>Since:</dt>
<dd>0.6</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="multiply(org.opengis.referencing.operation.Matrix,org.opengis.referencing.operation.Matrix)">
<h3>multiply</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">multiply</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;m1,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;m2)</span>
throws <span class="exceptions"><a href="MismatchedMatrixSizeException.html" title="class in org.apache.sis.referencing.operation.matrix">MismatchedMatrixSizeException</a></span></div>
<div class="block">Returns a new matrix which is the result of multiplying the first matrix with the second one.
In other words, returns <code>m1</code> × <code>m2</code>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>m1</code> - the first matrix to multiply.</dd>
<dd><code>m2</code> - the second matrix to multiply.</dd>
<dt>Returns:</dt>
<dd>the result of <code>m1</code> × <code>m2</code>.</dd>
<dt>Throws:</dt>
<dd><code><a href="MismatchedMatrixSizeException.html" title="class in org.apache.sis.referencing.operation.matrix">Mismatched­Matrix­Size­Exception</a></code> - if the number of columns in <code>m1</code> is not equals to the
number of rows in <code>m2</code>.</dd>
<dt>Since:</dt>
<dd>0.6</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="MatrixSIS.html#multiply(org.opengis.referencing.operation.Matrix)"><code>Matrix­SIS​.multiply(Matrix)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="inverse(org.opengis.referencing.operation.Matrix)">
<h3>inverse</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="MatrixSIS.html" title="class in org.apache.sis.referencing.operation.matrix">MatrixSIS</a></span>&nbsp;<span class="element-name">inverse</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix)</span>
throws <span class="exceptions"><a href="NoninvertibleMatrixException.html" title="class in org.apache.sis.referencing.operation.matrix">NoninvertibleMatrixException</a></span></div>
<div class="block">Returns the inverse of the given matrix.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>matrix</code> - the matrix to inverse, or <code>null</code>.</dd>
<dt>Returns:</dt>
<dd>the inverse of this matrix, or <code>null</code> if the given matrix was null.</dd>
<dt>Throws:</dt>
<dd><code><a href="NoninvertibleMatrixException.html" title="class in org.apache.sis.referencing.operation.matrix">Noninvertible­Matrix­Exception</a></code> - if the given matrix is not invertible.</dd>
<dt>Since:</dt>
<dd>0.6</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="MatrixSIS.html#inverse()"><code>Matrix­SIS​.inverse()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isAffine(org.opengis.referencing.operation.Matrix)">
<h3>isAffine</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isAffine</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix)</span></div>
<div class="block">Returns <code>true</code> if the given matrix represents an affine transform.
A transform is affine if the matrix is square and its last row contains
only zeros, except in the last column which contains 1.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>matrix</code> - the matrix to test.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if the matrix represents an affine transform.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="MatrixSIS.html#isAffine()"><code>Matrix­SIS​.is­Affine()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isTranslation(org.opengis.referencing.operation.Matrix)">
<h3>isTranslation</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isTranslation</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix)</span></div>
<div class="block">Returns <code>true</code> if the given matrix represents a translation.
This method returns <code>true</code> if the given matrix <a href="#isAffine(org.opengis.referencing.operation.Matrix)">is affine</a>
and differs from the identity matrix only in the last column.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>matrix</code> - the matrix to test.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if the matrix represents a translation.</dd>
<dt>Since:</dt>
<dd>0.7</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isIdentity(org.opengis.referencing.operation.Matrix,double)">
<h3>isIdentity</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isIdentity</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix,
double&nbsp;tolerance)</span></div>
<div class="block">Returns <code>true</code> if the given matrix is close to an identity matrix, given a tolerance threshold.
This method is equivalent to computing the difference between the given matrix and an identity matrix
of identical size, and returning <code>true</code> if and only if all differences are smaller than or equal
to <code>tolerance</code>.
<p><b>Caution:</b> <a href="../../datum/BursaWolfParameters.html" title="class in org.apache.sis.referencing.datum">Bursa-Wolf parameters</a>,
when represented as a matrix, are close to an identity transform and could easily be confused with rounding
errors. In case of doubt, it is often safer to use the strict <a href="MatrixSIS.html#isIdentity()"><code>Matrix­SIS​.is­Identity()</code></a> method instead
than this one.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>matrix</code> - the matrix to test for identity.</dd>
<dd><code>tolerance</code> - the tolerance value, or 0 for a strict comparison.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if this matrix is close to the identity matrix given the tolerance threshold.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="MatrixSIS.html#isIdentity()"><code>Matrix­SIS​.is­Identity()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="equals(org.opengis.referencing.operation.Matrix,org.opengis.referencing.operation.Matrix,double,boolean)">
<h3>equals</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">equals</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;m1,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;m2,
double&nbsp;epsilon,
boolean&nbsp;relative)</span></div>
<div class="block">Compares the given matrices for equality, using the given relative or absolute tolerance threshold.
The matrix elements are compared as below:
<ul>
<li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#NaN" title="class or interface in java.lang" class="external-link"><code>Double​.Na­N</code></a> values are considered equals to all other NaN values</li>
<li>Infinite values are considered equal to other infinite values of the same sign</li>
<li>All other values are considered equal if the absolute value of their difference is
smaller than or equals to the threshold described below.</li>
</ul>
If <code>relative</code> is <code>true</code>, then for any pair of values <var>v1</var><sub>j,i</sub>
and <var>v2</var><sub>j,i</sub> to compare, the tolerance threshold is scaled by
<code>max(abs(v1), abs(v2))</code>. Otherwise the threshold is used as-is.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>m1</code> - the first matrix to compare, or <code>null</code>.</dd>
<dd><code>m2</code> - the second matrix to compare, or <code>null</code>.</dd>
<dd><code>epsilon</code> - the tolerance value.</dd>
<dd><code>relative</code> - if <code>true</code>, then the tolerance value is relative to the magnitude
of the matrix elements being compared.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if the values of the two matrix do not differ by a quantity greater
than the given tolerance threshold.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="MatrixSIS.html#equals(org.opengis.referencing.operation.Matrix,double)"><code>Matrix­SIS​.equals(Matrix, double)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="equals(org.opengis.referencing.operation.Matrix,org.opengis.referencing.operation.Matrix,org.apache.sis.util.ComparisonMode)">
<h3>equals</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">equals</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;m1,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;m2,
<a href="../../../util/ComparisonMode.html" title="enum class in org.apache.sis.util">ComparisonMode</a>&nbsp;mode)</span></div>
<div class="block">Compares the given matrices for equality, using the given comparison strictness level.
To be considered equal, the two matrices must met the following conditions, which depend
on the <code>mode</code> argument:
<ul>
<li><a href="../../../util/ComparisonMode.html#STRICT"><code>STRICT</code></a>:
the two matrices must be of the same class, have the same size and the same element values.</li>
<li><a href="../../../util/ComparisonMode.html#BY_CONTRACT"><code>BY_CONTRACT</code></a>:
the two matrices must have the same size and the same element values,
but are not required to be the same implementation class (any <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link"><code>Matrix</code></a> is okay).</li>
<li><a href="../../../util/ComparisonMode.html#IGNORE_METADATA"><code>IGNORE_METADATA</code></a>: same as <code>BY_CONTRACT</code>,
since matrices have no metadata.</li>
<li><a href="../../../util/ComparisonMode.html#APPROXIMATE"><code>APPROXIMATE</code></a>:
the two matrices must have the same size, but the element values can differ up to some threshold.
The threshold value is determined empirically and may change in any future SIS versions.
For more control, use <a href="#equals(org.opengis.referencing.operation.Matrix,org.opengis.referencing.operation.Matrix,double,boolean)"><code>equals(Matrix, Matrix, double, boolean)</code></a> instead.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>m1</code> - the first matrix to compare, or <code>null</code>.</dd>
<dd><code>m2</code> - the second matrix to compare, or <code>null</code>.</dd>
<dd><code>mode</code> - the strictness level of the comparison.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if both matrices are equal.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="MatrixSIS.html#equals(java.lang.Object,org.apache.sis.util.ComparisonMode)"><code>Matrix­SIS​.equals(Object, Comparison­Mode)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toString(org.opengis.referencing.operation.Matrix)">
<h3>toString</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">toString</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a>&nbsp;matrix)</span></div>
<div class="block">Returns a unlocalized string representation of the given matrix.
For each column, the numbers are aligned on the decimal separator.
<p>The current implementation formats ±0 and ±1 without trailing <code>".0"</code>, and all other values with
a per-column uniform number of fraction digits. The ±0 and ±1 values are treated especially because they
usually imply a <cite>"no scale"</cite>, <cite>"no translation"</cite> or <cite>"orthogonal axes"</cite>
meaning. A matrix in SIS is often populated mostly by ±0 and ±1 values, with a few "interesting" values.
The simpler ±0 and ±1 formatting makes easier to spot the "interesting" values.</p>
<p>The following example shows the string representation of an affine transform which swap
(<var>latitude</var>, <var>longitude</var>) axes, converts degrees to radians and converts
height values from feet to metres:</p>
<blockquote><pre>┌ ┐
│ 0 0.017453292519943295 0 0 │
│ 0.017453292519943295 0 0 0 │
│ 0 0 0.3048 0 │
│ 0 0 0 1 │
└ ┘</pre></blockquote>
<div class="note"><b>Note:</b>
Formatting on a per-column basis is convenient for the kind of matrices used in referencing by coordinates,
because each column is typically a displacement vector in a different dimension of the source coordinate
reference system. In addition, the last column is often a translation vector having a magnitude very
different than the other columns.</div></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>matrix</code> - the matrix for which to get a string representation.</dd>
<dt>Returns:</dt>
<dd>a string representation of the given matrix.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2010&#x2013;2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>