Files
mp-units/HEAD/api_reference/gen/qty.rel.pt.orig.html
T

18 lines
6.4 KiB
HTML

<!DOCTYPE html><html lang='en'><head><title>[qty.rel.pt.orig]</title><meta charset='UTF-8'/><link rel='stylesheet' type='text/css' href='14882.css'/><link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css2?family=Noto+Serif'/><link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css2?family=Noto+Sans'/><link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css2?family=Noto+Sans+Mono'/><link rel='icon' href='icon.png'/><link rel='stylesheet' type='text/css' href='expanded.css' title='Normal'/><link rel='alternate stylesheet' type='text/css' href='colored.css' title='Notes and examples colored'/><link rel='alternate stylesheet' type='text/css' href='normative-only.css' title='Notes and examples hidden'/></head><body><div class='wrapper'><h1 ><a class='secnum' style='min-width:50pt'>5</a> Quantities and units library <a class='abbr_ref' href='index.html#quantities'>[quantities]</a></h1><h2 ><a class='secnum' style='min-width:65pt'>5.7</a> Quantity point <a class='abbr_ref' href='qty.pt.html#qty.rel.pt.orig'>[qty.pt]</a></h2><h3 ><a class='secnum' style='min-width:80pt'>5.7.2</a> Point origin <a class='abbr_ref' href='qty.pt.orig.html#qty.rel.pt.orig'>[qty.pt.orig]</a></h3><h4 ><a class='secnum' style='min-width:95pt'>5.7.2.3</a> Types <a class='abbr_ref' href='qty.pt.orig.types.html#qty.rel.pt.orig'>[qty.pt.orig.types]</a></h4><h4 ><a class='secnum' style='min-width:110pt'>5.7.2.3.2</a> Relative <a class='abbr_ref'>[qty.rel.pt.orig]</a></h4><div class='texpara'><span class='codeblock'><span class='keyword'>namespace</span> mp_units <span class='curlybracket'>{</span>
<span class='keyword'>template</span><span class='anglebracket'>&lt;</span><a href='qty.pt.syn.html#concept:QuantityPoint' title='5.7.4&emsp;Class template quantity_&shy;point&emsp;[qty.pt.syn]'><span id='conceptref:QuantityPoint'><span class='tcode_in_codeblock'>QuantityPoint</span></span></a> <span class='keyword'>auto</span> QP<span class='anglebracket'>&gt;</span>
<span class='keyword'>struct</span> <span id='lib:relative_point_origin'><a class='hidden_link' href='#lib:relative_point_origin' title='5.7.2.3.2&emsp;Relative&emsp;[qty.rel.pt.orig]'>relative_point_origin</a></span> <span class='operator'>:</span> <i >point-origin-interface</i> <span class='curlybracket'>{</span>
<span class='keyword'>static</span> <span class='keyword'>constexpr</span> <a href='qty.pt.syn.html#concept:QuantityPoint' title='5.7.4&emsp;Class template quantity_&shy;point&emsp;[qty.pt.syn]'><span id='conceptref:QuantityPoint_'><span class='tcode_in_codeblock'>QuantityPoint</span></span></a> <span class='keyword'>auto</span> <i >quantity-point</i> <span class='operator'>=</span> QP; <span class='comment'>// <i >exposition only</i></span>
<span class='keyword'>static</span> <span class='keyword'>constexpr</span> <a href='qty.spec.concepts.html#concept:QuantitySpec' title='5.4.3.2&emsp;Concepts&emsp;[qty.spec.concepts]'><span id='conceptref:QuantitySpec'><span class='tcode_in_codeblock'>QuantitySpec</span></span></a> <span class='keyword'>auto</span> <i >quantity-spec</i> <span class='operator'>=</span> <i ><span class='texttt'>see below</span></i>; <span class='comment'>// <i >exposition only</i></span>
<span class='keyword'>static</span> <span class='keyword'>constexpr</span> <a href='qty.pt.orig.concepts.html#concept:PointOrigin' title='5.7.2.2&emsp;Concepts&emsp;[qty.pt.orig.concepts]'><span id='conceptref:PointOrigin'><span class='tcode_in_codeblock'>PointOrigin</span></span></a> <span class='keyword'>auto</span> <i >absolute-point-origin</i> <span class='operator'>=</span> <span class='comment'>// <i >exposition only</i></span>
QP<span class='operator'>.</span>absolute_point_origin;
<span class='curlybracket'>}</span>;
<span class='curlybracket'>}</span>
</span></div><div class='para' id='1'><div class='marginalizedparent'><a class='marginalized' href='#1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L5513'>#</a></div><div class='texpara'><div id='1.sentence-1' class='sentence'>A <a class='hidden_link' href='#def:origin,relative' title='5.7.2.3.2&emsp;Relative&emsp;[qty.rel.pt.orig]'><span id='def:origin,relative'><i >relative origin</i></span></a> is an origin
of a subspace (<a href="https://www.electropedia.org/iev/iev.nsf/display?openform&ievref=102-03-03">IEC 60050, 102-03-03</a>)<a class='hidden_link' href='#1.sentence-1'>.</a></div> <div id='1.sentence-2' class='sentence'>A specialization of <span class='texttt'>relative_<span class='shy'></span>point_<span class='shy'></span>origin</span> is used as a base type when defining a relative origin <i >O</i><a class='hidden_link' href='#1.sentence-2'>.</a></div> <div id='1.sentence-3' class='sentence'><i >O</i> is offset from <span class='texttt'>QP<span class='operator'>.</span>absolute_<span class='shy'></span>point_<span class='shy'></span>origin</span> by <span class='texttt'>QP<span class='operator'>.</span>quantity_<span class='shy'></span>from_<span class='shy'></span>zero<span class='parenthesis'>(</span><span class='parenthesis'>)</span></span><a class='hidden_link' href='#1.sentence-3'>.</a></div></div></div><div class='para' id='2'><div class='marginalizedparent'><a class='marginalized' href='#2'>2</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L5519'>#</a></div><div class='texpara'><div id='2.sentence-1' class='sentence'>The member <span class='texttt'><i >quantity-spec</i></span> is equal to
<span class='texttt'>QP<span class='operator'>.</span>point_<span class='shy'></span>origin<span class='operator'>.</span><span class='texttt'><i >quantity-spec</i></span></span> if
<span class='codeblock'><a class='index' id='conceptref:QuantityKindSpec'></a><i >QuantityKindSpec</i><span class='anglebracket'>&lt;</span><span class='keyword'>decltype</span><span class='parenthesis'>(</span><span class='keyword'>auto</span><span class='parenthesis'>(</span>QP<span class='operator'>.</span><i >quantity-spec</i><span class='parenthesis'>)</span><span class='parenthesis'>)</span><span class='anglebracket'>&gt;</span>
</span>
is satisfied, and
to <span class='texttt'>QP<span class='operator'>.</span><span class='texttt'><i >quantity-spec</i></span></span> otherwise<a class='hidden_link' href='#2.sentence-1'>.</a></div></div></div></div></body></html>