3414 lines
100 KiB
HTML
3414 lines
100 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Class MathUtil | HiAPI-C# 2025 </title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="title" content="Class MathUtil | HiAPI-C# 2025 ">
|
|
|
|
<meta name="description" content="Math Utility.">
|
|
<link rel="icon" href="../img/HiAPI.favicon.ico">
|
|
<link rel="stylesheet" href="../public/docfx.min.css">
|
|
<link rel="stylesheet" href="../public/main.css">
|
|
<meta name="docfx:navrel" content="../toc.html">
|
|
<meta name="docfx:tocrel" content="toc.html">
|
|
|
|
<meta name="docfx:rel" content="../">
|
|
|
|
|
|
|
|
<meta name="loc:inThisArticle" content="In this article">
|
|
<meta name="loc:searchResultsCount" content="{count} results for "{query}"">
|
|
<meta name="loc:searchNoResults" content="No results for "{query}"">
|
|
<meta name="loc:tocFilter" content="Filter by title">
|
|
<meta name="loc:nextArticle" content="Next">
|
|
<meta name="loc:prevArticle" content="Previous">
|
|
<meta name="loc:themeLight" content="Light">
|
|
<meta name="loc:themeDark" content="Dark">
|
|
<meta name="loc:themeAuto" content="Auto">
|
|
<meta name="loc:changeTheme" content="Change theme">
|
|
<meta name="loc:copy" content="Copy">
|
|
<meta name="loc:downloadPdf" content="Download PDF">
|
|
|
|
<script type="module" src="./../public/docfx.min.js"></script>
|
|
|
|
<script>
|
|
const theme = localStorage.getItem('theme') || 'auto'
|
|
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
|
|
<header class="bg-body border-bottom">
|
|
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
|
|
<div class="container-xxl flex-nowrap">
|
|
<a class="navbar-brand" href="../index.html">
|
|
<img id="logo" class="svg" src="../img/HiAPI.logo.png" alt="">
|
|
|
|
</a>
|
|
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
|
|
<i class="bi bi-three-dots"></i>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navpanel">
|
|
<div id="navbar">
|
|
<form class="search" role="search" id="search">
|
|
<i class="bi bi-search"></i>
|
|
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<main class="container-xxl">
|
|
<div class="toc-offcanvas">
|
|
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
|
|
<div class="offcanvas-header">
|
|
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
|
|
</div>
|
|
<div class="offcanvas-body">
|
|
<nav class="toc" id="toc"></nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="content">
|
|
<div class="actionbar">
|
|
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
|
|
<i class="bi bi-list"></i>
|
|
</button>
|
|
|
|
<nav id="breadcrumb"></nav>
|
|
</div>
|
|
|
|
<article data-uid="Hi.Geom.MathUtil">
|
|
|
|
|
|
|
|
<h1 id="Hi_Geom_MathUtil" data-uid="Hi.Geom.MathUtil" class="text-break">
|
|
Class MathUtil
|
|
</h1>
|
|
|
|
<div class="facts text-secondary">
|
|
<dl><dt>Namespace</dt><dd><a class="xref" href="Hi.html">Hi</a>.<a class="xref" href="Hi.Geom.html">Geom</a></dd></dl>
|
|
<dl><dt>Assembly</dt><dd>HiGeom.dll</dd></dl>
|
|
</div>
|
|
|
|
<div class="markdown summary"><p>Math Utility.</p>
|
|
</div>
|
|
<div class="markdown conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static class MathUtil</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<dl class="typelist inheritance">
|
|
<dt>Inheritance</dt>
|
|
<dd>
|
|
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
|
|
<div><span class="xref">MathUtil</span></div>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
<dl class="typelist inheritedMembers">
|
|
<dt>Inherited Members</dt>
|
|
<dd>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone">object.MemberwiseClone()</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
|
|
</div>
|
|
<div>
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2 class="section" id="fields">Fields
|
|
</h2>
|
|
|
|
|
|
|
|
<h3 id="Hi_Geom_MathUtil_sqrt2" data-uid="Hi.Geom.MathUtil.sqrt2">
|
|
sqrt2
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>square root of 2.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public const double sqrt2 = 1.4142135623730951</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Field Value</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3 id="Hi_Geom_MathUtil_sqrt3" data-uid="Hi.Geom.MathUtil.sqrt3">
|
|
sqrt3
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>square root of 3.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public const double sqrt3 = 1.7320508075688772</code></pre>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Field Value</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2 class="section" id="methods">Methods
|
|
</h2>
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_AbsDiffAngle_" data-uid="Hi.Geom.MathUtil.AbsDiffAngle*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_AbsDiffAngle_System_Double_System_Double_" data-uid="Hi.Geom.MathUtil.AbsDiffAngle(System.Double,System.Double)">
|
|
AbsDiffAngle(double, double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Calculates the absolute difference between two angles in radians</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double AbsDiffAngle(double angleA_rad, double angleB_rad)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>angleA_rad</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>First angle in radians</p>
|
|
</dd>
|
|
<dt><code>angleB_rad</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Second angle in radians</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The absolute difference between the two angles</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Add_" data-uid="Hi.Geom.MathUtil.Add*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Add_System_Double___System_Double___" data-uid="Hi.Geom.MathUtil.Add(System.Double[],System.Double[])">
|
|
Add(double[], double[])
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Adds the elements of the second array to the corresponding elements of the first array in-place.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[] Add(this double[] src, double[] src2)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The source array to which elements will be added.</p>
|
|
</dd>
|
|
<dt><code>src2</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The array containing elements to add.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The modified source array.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_AlterIfNan_" data-uid="Hi.Geom.MathUtil.AlterIfNan*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_AlterIfNan_System_Double_System_Double_" data-uid="Hi.Geom.MathUtil.AlterIfNan(System.Double,System.Double)">
|
|
AlterIfNan(double, double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double AlterIfNan(double primaryValue, double alteringValue)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>primaryValue</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>primary value</p>
|
|
</dd>
|
|
<dt><code>alteringValue</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>the candidate value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_ApplyAlterIf_" data-uid="Hi.Geom.MathUtil.ApplyAlterIf*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_ApplyAlterIf__1___0_System_Func___0_System_Boolean____0_" data-uid="Hi.Geom.MathUtil.ApplyAlterIf``1(``0,System.Func{``0,System.Boolean},``0)">
|
|
ApplyAlterIf<T>(T, Func<T, bool>, T)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Applies an alternative value if the source value meets a specified condition.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static T ApplyAlterIf<T>(T src, Func<T, bool> isApplyingAlternateFunc, T alternative)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <span class="xref">T</span></dt>
|
|
<dd><p>The source value to check.</p>
|
|
</dd>
|
|
<dt><code>isApplyingAlternateFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a><T, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>></dt>
|
|
<dd><p>Function that determines if the alternative should be applied.</p>
|
|
</dd>
|
|
<dt><code>alternative</code> <span class="xref">T</span></dt>
|
|
<dd><p>The alternative value to use if the condition is met.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd><p>Either the original value or the alternative value based on the condition.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The type of the values.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Average_" data-uid="Hi.Geom.MathUtil.Average*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Average_System_Collections_Generic_IEnumerable_Hi_Geom_Vec3d__" data-uid="Hi.Geom.MathUtil.Average(System.Collections.Generic.IEnumerable{Hi.Geom.Vec3d})">
|
|
Average(IEnumerable<Vec3d>)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Average.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static Vec3d Average(this IEnumerable<Vec3d> src)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a><<a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a>></dt>
|
|
<dd><p>src</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
|
|
<dd><p>Average</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_BilinearInterpolate_" data-uid="Hi.Geom.MathUtil.BilinearInterpolate*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_BilinearInterpolate_System_Double_System_Double_System_Double_System_Double_System_Double_System_Double_" data-uid="Hi.Geom.MathUtil.BilinearInterpolate(System.Double,System.Double,System.Double,System.Double,System.Double,System.Double)">
|
|
BilinearInterpolate(double, double, double, double, double, double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Performs bilinear interpolation between four double values</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double BilinearInterpolate(double v00, double v01, double v10, double v11, double u, double v)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>v00</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value at (0,0) on normalized bilinear coordinate</p>
|
|
</dd>
|
|
<dt><code>v01</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value at (0,1) on normalized bilinear coordinate</p>
|
|
</dd>
|
|
<dt><code>v10</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value at (1,0) on normalized bilinear coordinate</p>
|
|
</dd>
|
|
<dt><code>v11</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value at (1,1) on normalized bilinear coordinate</p>
|
|
</dd>
|
|
<dt><code>u</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Ratio along v00 and v10, etc.</p>
|
|
</dd>
|
|
<dt><code>v</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Ratio along v00 and v01, etc.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The interpolated value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_BilinearInterpolate_" data-uid="Hi.Geom.MathUtil.BilinearInterpolate*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_BilinearInterpolate__1___0___0___0___0_System_Double_System_Double_" data-uid="Hi.Geom.MathUtil.BilinearInterpolate``1(``0,``0,``0,``0,System.Double,System.Double)">
|
|
BilinearInterpolate<T>(T, T, T, T, double, double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Bilinear interpolate.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static T BilinearInterpolate<T>(T v00, T v01, T v10, T v11, double u, double v) where T : IAdditionOperators<T, T, T>, IMultiplyOperators<T, double, T></code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>v00</code> <span class="xref">T</span></dt>
|
|
<dd><p>value at (0,0) on normalized bilinear coordinate</p>
|
|
</dd>
|
|
<dt><code>v01</code> <span class="xref">T</span></dt>
|
|
<dd><p>value at (0,1) on normalized bilinear coordinate</p>
|
|
</dd>
|
|
<dt><code>v10</code> <span class="xref">T</span></dt>
|
|
<dd><p>value at (1,0) on normalized bilinear coordinate</p>
|
|
</dd>
|
|
<dt><code>v11</code> <span class="xref">T</span></dt>
|
|
<dd><p>value at (1,1) on normalized bilinear coordinate</p>
|
|
</dd>
|
|
<dt><code>u</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>ratio along v00 and v10, etc.</p>
|
|
</dd>
|
|
<dt><code>v</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>ratio along v00 and v01, etc.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd><p>interpolated value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>value type.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_BilinearInterpolate_" data-uid="Hi.Geom.MathUtil.BilinearInterpolate*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_BilinearInterpolate__1___0___0___0___0_System_Double_System_Double_System_Func___0_System_Double___0__System_Func___0___0___0__" data-uid="Hi.Geom.MathUtil.BilinearInterpolate``1(``0,``0,``0,``0,System.Double,System.Double,System.Func{``0,System.Double,``0},System.Func{``0,``0,``0})">
|
|
BilinearInterpolate<T>(T, T, T, T, double, double, Func<T, double, T>, Func<T, T, T>)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Bilinear interpolate.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static T BilinearInterpolate<T>(T v00, T v01, T v10, T v11, double u, double v, Func<T, double, T> scalingFunc, Func<T, T, T> addingFunc)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>v00</code> <span class="xref">T</span></dt>
|
|
<dd><p>value at (0,0) on normalized bilinear coordinate</p>
|
|
</dd>
|
|
<dt><code>v01</code> <span class="xref">T</span></dt>
|
|
<dd><p>value at (0,1) on normalized bilinear coordinate</p>
|
|
</dd>
|
|
<dt><code>v10</code> <span class="xref">T</span></dt>
|
|
<dd><p>value at (1,0) on normalized bilinear coordinate</p>
|
|
</dd>
|
|
<dt><code>v11</code> <span class="xref">T</span></dt>
|
|
<dd><p>value at (1,1) on normalized bilinear coordinate</p>
|
|
</dd>
|
|
<dt><code>u</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>ratio along v00 and v10, etc.</p>
|
|
</dd>
|
|
<dt><code>v</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>ratio along v00 and v01, etc.</p>
|
|
</dd>
|
|
<dt><code>scalingFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a><T, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, T></dt>
|
|
<dd><p>scaling function</p>
|
|
</dd>
|
|
<dt><code>addingFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a><T, T, T></dt>
|
|
<dd><p>adding function</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd><p>interpolated value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>value type.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_BinaryDividentSequence_" data-uid="Hi.Geom.MathUtil.BinaryDividentSequence*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_BinaryDividentSequence_System_Int32_" data-uid="Hi.Geom.MathUtil.BinaryDividentSequence(System.Int32)">
|
|
BinaryDividentSequence(int)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Generates a value in a binary divident sequence based on the seed.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double BinaryDividentSequence(int seed)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>seed</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>The seed value for the sequence.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The value in the binary divident sequence.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Cbrt_" data-uid="Hi.Geom.MathUtil.Cbrt*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Cbrt_System_Double_" data-uid="Hi.Geom.MathUtil.Cbrt(System.Double)">
|
|
Cbrt(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Calculates the cube root of a number.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Cbrt(double v)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>v</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The value to calculate the cube root of.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The cube root of the specified value.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Clamp_" data-uid="Hi.Geom.MathUtil.Clamp*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Clamp__1___0___0___0_" data-uid="Hi.Geom.MathUtil.Clamp``1(``0,``0,``0)">
|
|
Clamp<T>(T, T, T)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Clamps a value within an inclusive range of minimum and maximum values.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static T Clamp<T>(this T val, T min, T max) where T : IComparable<T></code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>val</code> <span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
<dt><code>min</code> <span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
<dt><code>max</code> <span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Convert_inchdmin_To_mmds_" data-uid="Hi.Geom.MathUtil.Convert_inchdmin_To_mmds*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Convert_inchdmin_To_mmds_System_Double_" data-uid="Hi.Geom.MathUtil.Convert_inchdmin_To_mmds(System.Double)">
|
|
Convert_inchdmin_To_mmds(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Converts inches per minute to millimeters per second.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Convert_inchdmin_To_mmds(double inchdmin)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>inchdmin</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value in inches per minute.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value in millimeters per second.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Convert_mdmin_To_mmds_" data-uid="Hi.Geom.MathUtil.Convert_mdmin_To_mmds*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Convert_mdmin_To_mmds_System_Double_" data-uid="Hi.Geom.MathUtil.Convert_mdmin_To_mmds(System.Double)">
|
|
Convert_mdmin_To_mmds(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Converts meters per minute to millimeters per second.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Convert_mdmin_To_mmds(double mdmin)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>mdmin</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value in meters per minute.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value in millimeters per second.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Convert_mmdmin_To_mmds_" data-uid="Hi.Geom.MathUtil.Convert_mmdmin_To_mmds*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Convert_mmdmin_To_mmds_System_Double_" data-uid="Hi.Geom.MathUtil.Convert_mmdmin_To_mmds(System.Double)">
|
|
Convert_mmdmin_To_mmds(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Converts millimeters per minute to millimeters per second.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Convert_mmdmin_To_mmds(double mmdmin)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>mmdmin</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value in millimeters per minute.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value in millimeters per second.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Convert_mmds_To_mdmin_" data-uid="Hi.Geom.MathUtil.Convert_mmds_To_mdmin*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Convert_mmds_To_mdmin_System_Double_" data-uid="Hi.Geom.MathUtil.Convert_mmds_To_mdmin(System.Double)">
|
|
Convert_mmds_To_mdmin(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Converts millimeters per second to meters per minute.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Convert_mmds_To_mdmin(double mmds)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>mmds</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value in millimeters per second.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value in meters per minute.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Convert_mmds_To_mmdmin_" data-uid="Hi.Geom.MathUtil.Convert_mmds_To_mmdmin*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Convert_mmds_To_mmdmin_System_Double_" data-uid="Hi.Geom.MathUtil.Convert_mmds_To_mmdmin(System.Double)">
|
|
Convert_mmds_To_mmdmin(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Converts millimeters per second to millimeters per minute.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Convert_mmds_To_mmdmin(double mmds)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>mmds</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value in millimeters per second.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value in millimeters per minute.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Convert_radds_To_rpm_" data-uid="Hi.Geom.MathUtil.Convert_radds_To_rpm*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Convert_radds_To_rpm_System_Double_" data-uid="Hi.Geom.MathUtil.Convert_radds_To_rpm(System.Double)">
|
|
Convert_radds_To_rpm(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Converts radians per second to revolutions per minute (RPM).</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Convert_radds_To_rpm(double radds)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>radds</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value in radians per second.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value in revolutions per minute.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Convert_rpm_To_radds_" data-uid="Hi.Geom.MathUtil.Convert_rpm_To_radds*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Convert_rpm_To_radds_System_Double_" data-uid="Hi.Geom.MathUtil.Convert_rpm_To_radds(System.Double)">
|
|
Convert_rpm_To_radds(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Converts revolutions per minute (RPM) to radians per second.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Convert_rpm_To_radds(double rpm)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>rpm</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value in revolutions per minute.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>Value in radians per second.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Cycle_" data-uid="Hi.Geom.MathUtil.Cycle*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Cycle_System_Double_System_Double_System_Double_" data-uid="Hi.Geom.MathUtil.Cycle(System.Double,System.Double,System.Double)">
|
|
Cycle(double, double, double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>If the <code class="paramref">value</code> is within <code class="paramref">lowerBound</code> and <code class="paramref">upperBound</code>,
|
|
return <code class="paramref">value</code>.
|
|
Otherwise, perform looped value according to the direction from lower to upper.
|
|
ex. bound=(0,1), value=3.1, than return 0.1.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Cycle(double value, double lowerBound, double upperBound)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>value</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>value</p>
|
|
</dd>
|
|
<dt><code>lowerBound</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>lower bound, inclusive</p>
|
|
</dd>
|
|
<dt><code>upperBound</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>upper bound, exclusive</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>cycled value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Cycle_" data-uid="Hi.Geom.MathUtil.Cycle*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Cycle_System_Double_System_Double_System_Double_System_Boolean_" data-uid="Hi.Geom.MathUtil.Cycle(System.Double,System.Double,System.Double,System.Boolean)">
|
|
Cycle(double, double, double, bool)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Cycles a value to be within the specified range, with configurable bound inclusivity.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Cycle(double value, double lowerBound, double upperBound, bool isBothBoundInclusive)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>value</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The value to cycle.</p>
|
|
</dd>
|
|
<dt><code>lowerBound</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The lower bound of the range.</p>
|
|
</dd>
|
|
<dt><code>upperBound</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The upper bound of the range.</p>
|
|
</dd>
|
|
<dt><code>isBothBoundInclusive</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd><p>If true, both bounds are inclusive; otherwise, only the lower bound is inclusive.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The cycled value within the specified range.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Cycle2Pi_rad_" data-uid="Hi.Geom.MathUtil.Cycle2Pi_rad*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Cycle2Pi_rad_System_Double_System_Double_System_Boolean_" data-uid="Hi.Geom.MathUtil.Cycle2Pi_rad(System.Double,System.Double,System.Boolean)">
|
|
Cycle2Pi_rad(double, double, bool)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Get value by the cycle range transformation.
|
|
The cycle is from <code class="paramref">anchor_rad</code>-pi to <code class="paramref">anchor_rad</code>+pi.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Cycle2Pi_rad(double target_rad, double anchor_rad = 0, bool isBothBoundInclusive = false)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>target_rad</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>target angle</p>
|
|
</dd>
|
|
<dt><code>anchor_rad</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>anchor angle</p>
|
|
</dd>
|
|
<dt><code>isBothBoundInclusive</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd><p>if true, both bounds are inclusive; otherwise, only the lower bound is inclusive</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>adjusted target angle</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_CycleUnit_" data-uid="Hi.Geom.MathUtil.CycleUnit*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_CycleUnit_System_Double_" data-uid="Hi.Geom.MathUtil.CycleUnit(System.Double)">
|
|
CycleUnit(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Get the value locates on 0(inclusive) ~ 1(exclusive).
|
|
The source code:</p>
|
|
<pre><code class="lang-csharp">return v - Math.Floor(v);</code></pre>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double CycleUnit(double v)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>v</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>0 (inclusive) ~1 (exclusive)</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Decompose_" data-uid="Hi.Geom.MathUtil.Decompose*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Decompose_System_Double_0__0___System_Int32____System_Int32__" data-uid="Hi.Geom.MathUtil.Decompose(System.Double[0:,0:],System.Int32[]@,System.Int32@)">
|
|
Decompose(double[,], out int[], out int)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Performs LU decomposition with partial pivoting on a matrix.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[,] Decompose(double[,] matrix, out int[] perm, out int toggle)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>matrix</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>The matrix to decompose.</p>
|
|
</dd>
|
|
<dt><code>perm</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>[]</dt>
|
|
<dd><p>Output parameter that holds row permutations.</p>
|
|
</dd>
|
|
<dt><code>toggle</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>Output parameter that is +1 or -1 depending on whether the number of row exchanges is even or odd.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>The LU decomposition of the matrix.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Exceptions</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.exception">Exception</a></dt>
|
|
<dd><p>Thrown when attempting to decompose a non-square matrix.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Div_" data-uid="Hi.Geom.MathUtil.Div*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Div_System_Double___System_Double_" data-uid="Hi.Geom.MathUtil.Div(System.Double[],System.Double)">
|
|
Div(double[], double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Divides each element of the array by a scalar value in-place.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[] Div(this double[] src, double scale)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The source array to be modified.</p>
|
|
</dd>
|
|
<dt><code>scale</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The scalar value to divide by.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The modified source array.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Erf_" data-uid="Hi.Geom.MathUtil.Erf*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Erf_System_Double_" data-uid="Hi.Geom.MathUtil.Erf(System.Double)">
|
|
Erf(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Calculates the error function (erf) for the specified value.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Erf(double x)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>x</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The value to calculate the error function for</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The error function value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Erfc_" data-uid="Hi.Geom.MathUtil.Erfc*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Erfc_System_Double_" data-uid="Hi.Geom.MathUtil.Erfc(System.Double)">
|
|
Erfc(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Calculates the complementary error function (erfc) for the specified value.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Erfc(double x)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>x</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The value to calculate the complementary error function for</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The complementary error function value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_GetAbs_" data-uid="Hi.Geom.MathUtil.GetAbs*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_GetAbs_System_Double___" data-uid="Hi.Geom.MathUtil.GetAbs(System.Double[])">
|
|
GetAbs(double[])
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Creates a new array containing the absolute values of the elements in the source array.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[] GetAbs(this double[] src)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The source array.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>A new array containing the absolute values of the elements in the source array.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_GetAdd_" data-uid="Hi.Geom.MathUtil.GetAdd*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_GetAdd_System_Double___System_Double___" data-uid="Hi.Geom.MathUtil.GetAdd(System.Double[],System.Double[])">
|
|
GetAdd(double[], double[])
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Creates a new array by adding corresponding elements of two arrays.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[] GetAdd(this double[] src, double[] src2)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The first array.</p>
|
|
</dd>
|
|
<dt><code>src2</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The second array.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>A new array containing the sum of corresponding elements.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_GetCommonRatioFromGeometricSeries_" data-uid="Hi.Geom.MathUtil.GetCommonRatioFromGeometricSeries*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_GetCommonRatioFromGeometricSeries_System_Double_System_Double_System_Double_" data-uid="Hi.Geom.MathUtil.GetCommonRatioFromGeometricSeries(System.Double,System.Double,System.Double)">
|
|
GetCommonRatioFromGeometricSeries(double, double, double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Calculates the common ratio from a geometric series sum.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double GetCommonRatioFromGeometricSeries(double geometricSeriesSum, double powIndex, double convergenceLimit = 0.001)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>geometricSeriesSum</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The sum of the geometric series.</p>
|
|
</dd>
|
|
<dt><code>powIndex</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The power index in the series.</p>
|
|
</dd>
|
|
<dt><code>convergenceLimit</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The convergence limit for the calculation.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The common ratio of the geometric series.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_GetDiv_" data-uid="Hi.Geom.MathUtil.GetDiv*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_GetDiv_System_Double___System_Double_" data-uid="Hi.Geom.MathUtil.GetDiv(System.Double[],System.Double)">
|
|
GetDiv(double[], double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Creates a new array by dividing each element of the source array by a scalar value.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[] GetDiv(this double[] src, double scale)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The source array.</p>
|
|
</dd>
|
|
<dt><code>scale</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The scalar value to divide by.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>A new array with each element divided by the scalar value.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_GetDot_" data-uid="Hi.Geom.MathUtil.GetDot*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_GetDot_System_Double___System_Double___" data-uid="Hi.Geom.MathUtil.GetDot(System.Double[],System.Double[])">
|
|
GetDot(double[], double[])
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Creates a new array by multiplying corresponding elements of two arrays.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[] GetDot(this double[] a, double[] b)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>a</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The first array.</p>
|
|
</dd>
|
|
<dt><code>b</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The second array.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>A new array containing the product of corresponding elements.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_GetInterpolationRatio_" data-uid="Hi.Geom.MathUtil.GetInterpolationRatio*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_GetInterpolationRatio_System_TimeSpan_System_TimeSpan_System_TimeSpan_" data-uid="Hi.Geom.MathUtil.GetInterpolationRatio(System.TimeSpan,System.TimeSpan,System.TimeSpan)">
|
|
GetInterpolationRatio(TimeSpan, TimeSpan, TimeSpan)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Gets the interpolation ratio between two TimeSpan values</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double GetInterpolationRatio(TimeSpan begin, TimeSpan end, TimeSpan pos)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>begin</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
|
|
<dd><p>The beginning TimeSpan</p>
|
|
</dd>
|
|
<dt><code>end</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
|
|
<dd><p>The ending TimeSpan</p>
|
|
</dd>
|
|
<dt><code>pos</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
|
|
<dd><p>The position TimeSpan to calculate the ratio for</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The interpolation ratio: (pos - begin) / (end - begin)</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_GetInterpolationRatio_" data-uid="Hi.Geom.MathUtil.GetInterpolationRatio*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_GetInterpolationRatio__1___0___0___0_" data-uid="Hi.Geom.MathUtil.GetInterpolationRatio``1(``0,``0,``0)">
|
|
GetInterpolationRatio<T>(T, T, T)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Get position ratio.
|
|
(<code class="paramref">pos</code> - <code class="paramref">begin</code>) / (<code class="paramref">end</code> - <code class="paramref">begin</code>) .</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double GetInterpolationRatio<T>(T begin, T end, T pos) where T : ISubtractionOperators<T, T, T>, IDivisionOperators<T, T, double></code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>begin</code> <span class="xref">T</span></dt>
|
|
<dd><p>range begin</p>
|
|
</dd>
|
|
<dt><code>end</code> <span class="xref">T</span></dt>
|
|
<dd><p>range end</p>
|
|
</dd>
|
|
<dt><code>pos</code> <span class="xref">T</span></dt>
|
|
<dd><p>key position</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>position ratio</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_GetInterpolationRatio_" data-uid="Hi.Geom.MathUtil.GetInterpolationRatio*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_GetInterpolationRatio__1___0___0___0_System_Func___0___0___0__System_Func___0___0_System_Double__" data-uid="Hi.Geom.MathUtil.GetInterpolationRatio``1(``0,``0,``0,System.Func{``0,``0,``0},System.Func{``0,``0,System.Double})">
|
|
GetInterpolationRatio<T>(T, T, T, Func<T, T, T>, Func<T, T, double>)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Gets the interpolation ratio between two values using custom subtraction and division functions</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double GetInterpolationRatio<T>(T begin, T end, T pos, Func<T, T, T> minusFunc, Func<T, T, double> divFunc)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>begin</code> <span class="xref">T</span></dt>
|
|
<dd><p>The beginning value</p>
|
|
</dd>
|
|
<dt><code>end</code> <span class="xref">T</span></dt>
|
|
<dd><p>The ending value</p>
|
|
</dd>
|
|
<dt><code>pos</code> <span class="xref">T</span></dt>
|
|
<dd><p>The position value to calculate the ratio for</p>
|
|
</dd>
|
|
<dt><code>minusFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a><T, T, T></dt>
|
|
<dd><p>The function to use for subtraction</p>
|
|
</dd>
|
|
<dt><code>divFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a><T, T, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>></dt>
|
|
<dd><p>The function to use for division</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The interpolation ratio: (pos - begin) / (end - begin)</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The type of the values</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_GetMul_" data-uid="Hi.Geom.MathUtil.GetMul*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_GetMul_System_Double___System_Double_" data-uid="Hi.Geom.MathUtil.GetMul(System.Double[],System.Double)">
|
|
GetMul(double[], double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Creates a new array by multiplying each element of the source array by a scalar value.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[] GetMul(this double[] src, double s)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The source array.</p>
|
|
</dd>
|
|
<dt><code>s</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The scalar value to multiply by.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>A new array with each element multiplied by the scalar value.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_GetSub_" data-uid="Hi.Geom.MathUtil.GetSub*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_GetSub_System_Double___System_Double___" data-uid="Hi.Geom.MathUtil.GetSub(System.Double[],System.Double[])">
|
|
GetSub(double[], double[])
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Creates a new array by subtracting corresponding elements of the second array from the first array.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[] GetSub(this double[] a, double[] b)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>a</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The first array.</p>
|
|
</dd>
|
|
<dt><code>b</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The second array to subtract.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>A new array containing the difference of corresponding elements.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Idt_" data-uid="Hi.Geom.MathUtil.Idt*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Idt_System_Int32_" data-uid="Hi.Geom.MathUtil.Idt(System.Int32)">
|
|
Idt(int)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Creates an identity matrix of the specified size.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[,] Idt(int n)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>n</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>The size of the square identity matrix.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>An n x n identity matrix.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Interpolate_" data-uid="Hi.Geom.MathUtil.Interpolate*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Interpolate_System_TimeSpan_System_TimeSpan_System_Double_" data-uid="Hi.Geom.MathUtil.Interpolate(System.TimeSpan,System.TimeSpan,System.Double)">
|
|
Interpolate(TimeSpan, TimeSpan, double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Interpolates between two TimeSpan values using the specified ratio</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static TimeSpan Interpolate(TimeSpan a, TimeSpan b, double ratio)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>a</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
|
|
<dd><p>The first TimeSpan value</p>
|
|
</dd>
|
|
<dt><code>b</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
|
|
<dd><p>The second TimeSpan value</p>
|
|
</dd>
|
|
<dt><code>ratio</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The interpolation ratio (0.0 to 1.0)</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.timespan">TimeSpan</a></dt>
|
|
<dd><p>The interpolated TimeSpan value: a * (1 - ratio) + b * ratio</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_InterpolateWithinBoundary_" data-uid="Hi.Geom.MathUtil.InterpolateWithinBoundary*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_InterpolateWithinBoundary__1___0___0_System_Double_" data-uid="Hi.Geom.MathUtil.InterpolateWithinBoundary``1(``0,``0,System.Double)">
|
|
InterpolateWithinBoundary<T>(T, T, double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>If <code class="paramref">ratio</code> smaller or equal 0, return a.
|
|
If <code class="paramref">ratio</code> larger or equal 1, return b.
|
|
Otherwise, interpolate by <code class="paramref">ratio</code>.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static T InterpolateWithinBoundary<T>(T a, T b, double ratio) where T : IEqualityOperators<T, T, bool>, IAdditionOperators<T, T, T>, IMultiplyOperators<T, double, T></code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>a</code> <span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
<dt><code>b</code> <span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
<dt><code>ratio</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Interpolate_" data-uid="Hi.Geom.MathUtil.Interpolate*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Interpolate__1___0___0_System_Double_" data-uid="Hi.Geom.MathUtil.Interpolate``1(``0,``0,System.Double)">
|
|
Interpolate<T>(T, T, double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Interpolate from a to b with ratio alpha:(1-alpha).</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static T Interpolate<T>(T a, T b, double ratio) where T : IEqualityOperators<T, T, bool>, IAdditionOperators<T, T, T>, IMultiplyOperators<T, double, T></code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>a</code> <span class="xref">T</span></dt>
|
|
<dd><p>a</p>
|
|
</dd>
|
|
<dt><code>b</code> <span class="xref">T</span></dt>
|
|
<dd><p>b</p>
|
|
</dd>
|
|
<dt><code>ratio</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>ratio</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd><p>a * (1 - ratio) + b * ratio</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Interpolate_" data-uid="Hi.Geom.MathUtil.Interpolate*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Interpolate__1___0___0_System_Double_System_Func___0_System_Double__" data-uid="Hi.Geom.MathUtil.Interpolate``1(``0,``0,System.Double,System.Func{``0,System.Double})">
|
|
Interpolate<T>(T, T, double, Func<T, double>)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Interpolates between two values based on a position using a position function.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static T Interpolate<T>(T a, T b, double pos, Func<T, double> posFunc) where T : INumber<T>, IMultiplyOperators<T, double, T></code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>a</code> <span class="xref">T</span></dt>
|
|
<dd><p>The first value</p>
|
|
</dd>
|
|
<dt><code>b</code> <span class="xref">T</span></dt>
|
|
<dd><p>The second value</p>
|
|
</dd>
|
|
<dt><code>pos</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The position to interpolate at</p>
|
|
</dd>
|
|
<dt><code>posFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a><T, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>></dt>
|
|
<dd><p>Function to extract a position from a value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd><p>The interpolated value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The type of the values</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Interpolate_" data-uid="Hi.Geom.MathUtil.Interpolate*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Interpolate__1___0___0_System_Double_System_Func___0_System_Double__System_Func___0___0___0__System_Func___0_System_Double___0__" data-uid="Hi.Geom.MathUtil.Interpolate``1(``0,``0,System.Double,System.Func{``0,System.Double},System.Func{``0,``0,``0},System.Func{``0,System.Double,``0})">
|
|
Interpolate<TItem>(TItem, TItem, double, Func<TItem, double>, Func<TItem, TItem, TItem>, Func<TItem, double, TItem>)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Interpolates between two items based on a key value using custom functions.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static TItem Interpolate<TItem>(TItem a, TItem b, double key, Func<TItem, double> keyFunc, Func<TItem, TItem, TItem> addingFunc, Func<TItem, double, TItem> scalingFunc)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>a</code> <span class="xref">TItem</span></dt>
|
|
<dd><p>The first item</p>
|
|
</dd>
|
|
<dt><code>b</code> <span class="xref">TItem</span></dt>
|
|
<dd><p>The second item</p>
|
|
</dd>
|
|
<dt><code>key</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The key value to interpolate at (0.0 to 1.0)</p>
|
|
</dd>
|
|
<dt><code>keyFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a><TItem, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>></dt>
|
|
<dd><p>Function to extract a double key from an item</p>
|
|
</dd>
|
|
<dt><code>addingFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a><TItem, TItem, TItem></dt>
|
|
<dd><p>Function to add two items</p>
|
|
</dd>
|
|
<dt><code>scalingFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a><TItem, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, TItem></dt>
|
|
<dd><p>Function to scale an item by a double</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">TItem</span></dt>
|
|
<dd><p>The interpolated item</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>TItem</code></dt>
|
|
<dd><p>The type of the items</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Interpolate_" data-uid="Hi.Geom.MathUtil.Interpolate*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Interpolate__1___0___0_System_Double_System_Func___0___0___0__System_Func___0_System_Double___0__" data-uid="Hi.Geom.MathUtil.Interpolate``1(``0,``0,System.Double,System.Func{``0,``0,``0},System.Func{``0,System.Double,``0})">
|
|
Interpolate<T>(T, T, double, Func<T, T, T>, Func<T, double, T>)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Interpolates between two values using custom addition and scaling functions</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static T Interpolate<T>(T a, T b, double ratio, Func<T, T, T> addingFunc, Func<T, double, T> scalingFunc)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>a</code> <span class="xref">T</span></dt>
|
|
<dd><p>The first value</p>
|
|
</dd>
|
|
<dt><code>b</code> <span class="xref">T</span></dt>
|
|
<dd><p>The second value</p>
|
|
</dd>
|
|
<dt><code>ratio</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The interpolation ratio (0.0 to 1.0)</p>
|
|
</dd>
|
|
<dt><code>addingFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a><T, T, T></dt>
|
|
<dd><p>The function to use for addition</p>
|
|
</dd>
|
|
<dt><code>scalingFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a><T, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, T></dt>
|
|
<dd><p>The function to use for scaling</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd><p>The interpolated value: a * (1 - ratio) + b * ratio</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The type of the values</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Interpolate_" data-uid="Hi.Geom.MathUtil.Interpolate*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Interpolate__1___0_____0___System_Double_" data-uid="Hi.Geom.MathUtil.Interpolate``1(``0[],``0[],System.Double)">
|
|
Interpolate<T>(T[], T[], double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Interpolates between two arrays of values using the specified ratio</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static T[] Interpolate<T>(T[] a, T[] b, double ratio) where T : INumber<T>, IMultiplyOperators<T, double, T></code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>a</code> T[]</dt>
|
|
<dd><p>The first array</p>
|
|
</dd>
|
|
<dt><code>b</code> T[]</dt>
|
|
<dd><p>The second array</p>
|
|
</dd>
|
|
<dt><code>ratio</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The interpolation ratio (0.0 to 1.0)</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt>T[]</dt>
|
|
<dd><p>A new array containing the interpolated values</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd><p>The type of the array elements</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Interpolate_" data-uid="Hi.Geom.MathUtil.Interpolate*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Interpolate__2___1___1___0_System_Func___1___0__System_Func___0___0___0__System_Func___0___0_System_Double__System_Func___1___1___1__System_Func___1_System_Double___1__" data-uid="Hi.Geom.MathUtil.Interpolate``2(``1,``1,``0,System.Func{``1,``0},System.Func{``0,``0,``0},System.Func{``0,``0,System.Double},System.Func{``1,``1,``1},System.Func{``1,System.Double,``1})">
|
|
Interpolate<TKey, TItem>(TItem, TItem, TKey, Func<TItem, TKey>, Func<TKey, TKey, TKey>, Func<TKey, TKey, double>, Func<TItem, TItem, TItem>, Func<TItem, double, TItem>)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Interpolates between two items using custom key extraction, key operations, and item operations</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static TItem Interpolate<TKey, TItem>(TItem a, TItem b, TKey key, Func<TItem, TKey> keyFunc, Func<TKey, TKey, TKey> keyMinusFunc, Func<TKey, TKey, double> keyDivFunc, Func<TItem, TItem, TItem> itemAddingFunc, Func<TItem, double, TItem> itemScalingFunc)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>a</code> <span class="xref">TItem</span></dt>
|
|
<dd><p>The first item</p>
|
|
</dd>
|
|
<dt><code>b</code> <span class="xref">TItem</span></dt>
|
|
<dd><p>The second item</p>
|
|
</dd>
|
|
<dt><code>key</code> <span class="xref">TKey</span></dt>
|
|
<dd><p>The key value to interpolate at</p>
|
|
</dd>
|
|
<dt><code>keyFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-2">Func</a><TItem, TKey></dt>
|
|
<dd><p>Function to extract a key from an item</p>
|
|
</dd>
|
|
<dt><code>keyMinusFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a><TKey, TKey, TKey></dt>
|
|
<dd><p>Function to subtract keys</p>
|
|
</dd>
|
|
<dt><code>keyDivFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a><TKey, TKey, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>></dt>
|
|
<dd><p>Function to divide keys</p>
|
|
</dd>
|
|
<dt><code>itemAddingFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a><TItem, TItem, TItem></dt>
|
|
<dd><p>Function to add items</p>
|
|
</dd>
|
|
<dt><code>itemScalingFunc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.func-3">Func</a><TItem, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>, TItem></dt>
|
|
<dd><p>Function to scale items</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">TItem</span></dt>
|
|
<dd><p>The interpolated item</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>TKey</code></dt>
|
|
<dd><p>The type of the key used for interpolation</p>
|
|
</dd>
|
|
<dt><code>TItem</code></dt>
|
|
<dd><p>The type of the items being interpolated</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Inverse_" data-uid="Hi.Geom.MathUtil.Inverse*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Inverse_System_Double_0__0___" data-uid="Hi.Geom.MathUtil.Inverse(System.Double[0:,0:])">
|
|
Inverse(double[,])
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Computes the inverse of a matrix.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[,] Inverse(double[,] matrix)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>matrix</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>The matrix to invert.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>The inverse of the matrix.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Exceptions</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.exception">Exception</a></dt>
|
|
<dd><p>Thrown when the matrix cannot be inverted.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Inverse2d_" data-uid="Hi.Geom.MathUtil.Inverse2d*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Inverse2d_System_Double_0__0___System_Double_0__0___" data-uid="Hi.Geom.MathUtil.Inverse2d(System.Double[0:,0:],System.Double[0:,0:])">
|
|
Inverse2d(double[,], double[,])
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Calculates the inverse of a 2x2 matrix</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static void Inverse2d(double[,] src, double[,] dst)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>The source 2x2 matrix</p>
|
|
</dd>
|
|
<dt><code>dst</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>The destination matrix to store the inverse</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Inverse3d_" data-uid="Hi.Geom.MathUtil.Inverse3d*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Inverse3d_System_Double_0__0___System_Double_0__0___" data-uid="Hi.Geom.MathUtil.Inverse3d(System.Double[0:,0:],System.Double[0:,0:])">
|
|
Inverse3d(double[,], double[,])
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Calculates the inverse of a 3x3 matrix</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static void Inverse3d(double[,] src, double[,] dst)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>The source 3x3 matrix</p>
|
|
</dd>
|
|
<dt><code>dst</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>The destination matrix to store the inverse</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_IsFinite_" data-uid="Hi.Geom.MathUtil.IsFinite*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_IsFinite_System_Double_" data-uid="Hi.Geom.MathUtil.IsFinite(System.Double)">
|
|
IsFinite(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Is <code class="paramref">v</code> neither NaN nor infinity.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static bool IsFinite(double v)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>v</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
|
|
<dd><p>Is <code class="paramref">v</code> neither NaN nor infinity.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Max_" data-uid="Hi.Geom.MathUtil.Max*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Max__1___0___0_" data-uid="Hi.Geom.MathUtil.Max``1(``0,``0)">
|
|
Max<T>(T, T)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static T Max<T>(T a, T b) where T : IComparable<T></code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>a</code> <span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
<dt><code>b</code> <span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Min_" data-uid="Hi.Geom.MathUtil.Min*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Min__1___0___0_" data-uid="Hi.Geom.MathUtil.Min``1(``0,``0)">
|
|
Min<T>(T, T)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static T Min<T>(T a, T b) where T : IComparable<T></code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>a</code> <span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
<dt><code>b</code> <span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><span class="xref">T</span></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Type Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>T</code></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Mul_" data-uid="Hi.Geom.MathUtil.Mul*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Mul_System_Double___System_Double_" data-uid="Hi.Geom.MathUtil.Mul(System.Double[],System.Double)">
|
|
Mul(double[], double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Multiplies each element of the array by a scalar value in-place.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[] Mul(this double[] src, double scale)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The source array to be modified.</p>
|
|
</dd>
|
|
<dt><code>scale</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The scalar value to multiply by.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The modified source array.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_NoChanged_" data-uid="Hi.Geom.MathUtil.NoChanged*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_NoChanged_System_Double_" data-uid="Hi.Geom.MathUtil.NoChanged(System.Double)">
|
|
NoChanged(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Do nothing.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double NoChanged(double src)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>src</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p><code class="paramref">src</code></p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Norm2_" data-uid="Hi.Geom.MathUtil.Norm2*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Norm2_System_Double___" data-uid="Hi.Geom.MathUtil.Norm2(System.Double[])">
|
|
Norm2(double[])
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Calculates the Euclidean norm (L2 norm) of a vector.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Norm2(this double[] src)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The source vector as an array of doubles.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The Euclidean norm of the vector.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Normalized_" data-uid="Hi.Geom.MathUtil.Normalized*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Normalized_System_Double___" data-uid="Hi.Geom.MathUtil.Normalized(System.Double[])">
|
|
Normalized(double[])
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Creates a new array by normalizing the source array to have a unit norm.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[] Normalized(this double[] src)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The source array.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>A new array with the same direction as the source array but with unit norm.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Pow3_" data-uid="Hi.Geom.MathUtil.Pow3*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Pow3_System_Double_" data-uid="Hi.Geom.MathUtil.Pow3(System.Double)">
|
|
Pow3(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Calculates the cube (power of 3) of a double value.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Pow3(this double src)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The source double value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The cube of the source value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Pow3_" data-uid="Hi.Geom.MathUtil.Pow3*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Pow3_System_Int32_" data-uid="Hi.Geom.MathUtil.Pow3(System.Int32)">
|
|
Pow3(int)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Calculates the cube (power of 3) of an integer value.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static int Pow3(this int src)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>The source integer value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>The cube of the source value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Pow4_" data-uid="Hi.Geom.MathUtil.Pow4*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Pow4_System_Double_" data-uid="Hi.Geom.MathUtil.Pow4(System.Double)">
|
|
Pow4(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Calculates the fourth power of a double value.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Pow4(this double src)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The source double value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The fourth power of the source value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Pow4_" data-uid="Hi.Geom.MathUtil.Pow4*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Pow4_System_Int32_" data-uid="Hi.Geom.MathUtil.Pow4(System.Int32)">
|
|
Pow4(int)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Calculates the fourth power of an integer value.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static int Pow4(this int src)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>The source integer value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>The fourth power of the source value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Product_" data-uid="Hi.Geom.MathUtil.Product*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Product_System_Double_0__0___System_Double_0__0___" data-uid="Hi.Geom.MathUtil.Product(System.Double[0:,0:],System.Double[0:,0:])">
|
|
Product(double[,], double[,])
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Multiplies two matrices.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[,] Product(double[,] matrixA, double[,] matrixB)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>matrixA</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>The first matrix.</p>
|
|
</dd>
|
|
<dt><code>matrixB</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>The second matrix.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>The product of the two matrices.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h4 class="section">Exceptions</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.exception">Exception</a></dt>
|
|
<dd><p>Thrown when the matrices are not conformable for multiplication.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_SolveCubic_" data-uid="Hi.Geom.MathUtil.SolveCubic*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_SolveCubic_System_Double_System_Double_System_Double_System_Double_" data-uid="Hi.Geom.MathUtil.SolveCubic(System.Double,System.Double,System.Double,System.Double)">
|
|
SolveCubic(double, double, double, double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"></div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static Complex[] SolveCubic(double c0, double c1, double c2, double c3)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>c0</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>constant term.</p>
|
|
</dd>
|
|
<dt><code>c1</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>coefficient of power of 1 of x.</p>
|
|
</dd>
|
|
<dt><code>c2</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>coefficient of power of 2 of x.</p>
|
|
</dd>
|
|
<dt><code>c3</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>coefficient of power of 3 of x.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.numerics.complex">Complex</a>[]</dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_SolveQuadratic_" data-uid="Hi.Geom.MathUtil.SolveQuadratic*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_SolveQuadratic_System_Double_System_Double_System_Double_System_Double__System_Double__" data-uid="Hi.Geom.MathUtil.SolveQuadratic(System.Double,System.Double,System.Double,System.Double@,System.Double@)">
|
|
SolveQuadratic(double, double, double, out double, out double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Solve quadratic equation.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double SolveQuadratic(double c, double b, double a, out double x0, out double x1)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>c</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>coefficient of constant of x.</p>
|
|
</dd>
|
|
<dt><code>b</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>coefficient of power of 1 of x.</p>
|
|
</dd>
|
|
<dt><code>a</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>coefficient of power of 2 of x.</p>
|
|
</dd>
|
|
<dt><code>x0</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>lower root</p>
|
|
</dd>
|
|
<dt><code>x1</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>higher root</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>determinent</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_SqrtVariance_" data-uid="Hi.Geom.MathUtil.SqrtVariance*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_SqrtVariance_System_Collections_Generic_IList_System_Double__System_Double__" data-uid="Hi.Geom.MathUtil.SqrtVariance(System.Collections.Generic.IList{System.Double},System.Double@)">
|
|
SqrtVariance(IList<double>, out double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Standard deviation with n denominator (instead of n-1).</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double SqrtVariance(IList<double> src, out double avg)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1">IList</a><<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>></dt>
|
|
<dd></dd>
|
|
<dt><code>avg</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd></dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>STD</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Square_" data-uid="Hi.Geom.MathUtil.Square*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Square_System_Double_" data-uid="Hi.Geom.MathUtil.Square(System.Double)">
|
|
Square(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Calculates the square of a double value.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double Square(this double src)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The source double value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>The square of the source value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Square_" data-uid="Hi.Geom.MathUtil.Square*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Square_System_Int32_" data-uid="Hi.Geom.MathUtil.Square(System.Int32)">
|
|
Square(int)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Calculates the square of an integer value.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static int Square(this int src)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>The source integer value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
|
|
<dd><p>The square of the source value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Sum_" data-uid="Hi.Geom.MathUtil.Sum*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Sum_System_Collections_Generic_IEnumerable_Hi_Geom_Vec3d__" data-uid="Hi.Geom.MathUtil.Sum(System.Collections.Generic.IEnumerable{Hi.Geom.Vec3d})">
|
|
Sum(IEnumerable<Vec3d>)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Sum.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static Vec3d Sum(this IEnumerable<Vec3d> src)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a><<a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a>></dt>
|
|
<dd><p>src</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="Hi.Geom.Vec3d.html">Vec3d</a></dt>
|
|
<dd><p>Sum</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_ToDeg_" data-uid="Hi.Geom.MathUtil.ToDeg*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_ToDeg_System_Double_" data-uid="Hi.Geom.MathUtil.ToDeg(System.Double)">
|
|
ToDeg(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Get degree from radian.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double ToDeg(double rad)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>rad</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>radian</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>degree</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_ToRad_" data-uid="Hi.Geom.MathUtil.ToRad*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_ToRad_System_Double_" data-uid="Hi.Geom.MathUtil.ToRad(System.Double)">
|
|
ToRad(double)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Get radian from degree.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double ToRad(double deg)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>deg</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>degree</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>radian</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_ToString_" data-uid="Hi.Geom.MathUtil.ToString*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_ToString_System_Double_0__0___System_String_" data-uid="Hi.Geom.MathUtil.ToString(System.Double[0:,0:],System.String)">
|
|
ToString(double[,], string)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Converts a 2D double array to a string representation using the specified format</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static string ToString(this double[,] src, string format)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>The source 2D double array</p>
|
|
</dd>
|
|
<dt><code>format</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
|
<dd><p>The format string to use for each double value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
|
<dd><p>A string representation of the 2D array</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_ToString_" data-uid="Hi.Geom.MathUtil.ToString*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_ToString_System_Double___System_String_" data-uid="Hi.Geom.MathUtil.ToString(System.Double[],System.String)">
|
|
ToString(double[], string)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Converts a double array to a string representation using the specified format</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static string ToString(this double[] src, string format)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</dt>
|
|
<dd><p>The source double array</p>
|
|
</dd>
|
|
<dt><code>format</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
|
<dd><p>The format string to use for each double value</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
|
<dd><p>A string representation of the array</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_ToStringWithoutCultureNum_" data-uid="Hi.Geom.MathUtil.ToStringWithoutCultureNum*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_ToStringWithoutCultureNum_System_Double_System_String_" data-uid="Hi.Geom.MathUtil.ToStringWithoutCultureNum(System.Double,System.String)">
|
|
ToStringWithoutCultureNum(double, string)
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>To string function. The special number is formatted by <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.xml.xmlconvert">XmlConvert</a>.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static string ToStringWithoutCultureNum(this double src, string format)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a></dt>
|
|
<dd><p>src</p>
|
|
</dd>
|
|
<dt><code>format</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
|
<dd><p>format</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
|
<dd><p>string</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="Hi_Geom_MathUtil_Transpose_" data-uid="Hi.Geom.MathUtil.Transpose*"></a>
|
|
|
|
<h3 id="Hi_Geom_MathUtil_Transpose_System_Double_0__0___" data-uid="Hi.Geom.MathUtil.Transpose(System.Double[0:,0:])">
|
|
Transpose(double[,])
|
|
|
|
</h3>
|
|
|
|
<div class="markdown level1 summary"><p>Transposes a 2D matrix represented as a 2D array.</p>
|
|
</div>
|
|
<div class="markdown level1 conceptual"></div>
|
|
|
|
<div class="codewrapper">
|
|
<pre><code class="lang-csharp hljs">public static double[,] Transpose(double[,] src)</code></pre>
|
|
</div>
|
|
|
|
<h4 class="section">Parameters</h4>
|
|
<dl class="parameters">
|
|
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>The source matrix to transpose.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h4 class="section">Returns</h4>
|
|
<dl class="parameters">
|
|
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[,]</dt>
|
|
<dd><p>A new matrix that is the transpose of the source matrix.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</article>
|
|
|
|
<div class="contribution d-print-none">
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="affix">
|
|
<nav id="affix"></nav>
|
|
</div>
|
|
</main>
|
|
|
|
<div class="container-xxl search-results" id="search-results"></div>
|
|
|
|
<footer class="border-top text-secondary">
|
|
<div class="container-xxl">
|
|
<div class="flex-fill">
|
|
<span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|