<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcMap Field Calculator Power function in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/arcmap-field-calculator-power-function/m-p/829676#M1922</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, found the issue &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; Need to convert degrees to radians to prevent negative values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(0.27 * (&amp;nbsp; ( math.tan ( !RASTERVALU! *&amp;nbsp; ( 3.14159 / 180 ) ) * %Wave Height (Hs)% * %Wave Period (T)% ) ** (0.5) )) * 1.39&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Mar 2018 22:58:18 GMT</pubDate>
    <dc:creator>RichardDaniels</dc:creator>
    <dc:date>2018-03-21T22:58:18Z</dc:date>
    <item>
      <title>ArcMap Field Calculator Power function</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/arcmap-field-calculator-power-function/m-p/829675#M1921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the field calculator in a model to calculate a field.&amp;nbsp; I have the following expression,&amp;nbsp;type is set to VB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0.27 * (&amp;nbsp; ( Tan ( [RASTERVALU] ) * %Wave Height (Hs)% * %Wave Period (T)% ) ^ (0.5) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This returns an error. If I remove the Power function (i.e., ^ 0.5) it works. Note, RASTERVALU is not null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2018 22:20:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/arcmap-field-calculator-power-function/m-p/829675#M1921</guid>
      <dc:creator>RichardDaniels</dc:creator>
      <dc:date>2018-03-21T22:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap Field Calculator Power function</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/arcmap-field-calculator-power-function/m-p/829676#M1922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, found the issue &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; Need to convert degrees to radians to prevent negative values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(0.27 * (&amp;nbsp; ( math.tan ( !RASTERVALU! *&amp;nbsp; ( 3.14159 / 180 ) ) * %Wave Height (Hs)% * %Wave Period (T)% ) ** (0.5) )) * 1.39&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2018 22:58:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/arcmap-field-calculator-power-function/m-p/829676#M1922</guid>
      <dc:creator>RichardDaniels</dc:creator>
      <dc:date>2018-03-21T22:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap Field Calculator Power function</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/arcmap-field-calculator-power-function/m-p/829677#M1923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, degrees to radians AND use the python ** operator, of course using the PYTHON_9.3 parser:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0.27&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; math&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;tan &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; !RASTERVALU! &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3.14159&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;180&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; 
&amp;nbsp; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt;Wave Height &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Hs&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt;Wave Period &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;T&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;**&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0.5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1.39&lt;/SPAN&gt;‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note the math module has a function for this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;(0.27 * (( math.tan(math.radians(!RASTERVALU!)) 
&amp;nbsp; * %Wave Height (Hs)% * %Wave Period (T)% ) ** 0.5)) * 1.39‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:00:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/arcmap-field-calculator-power-function/m-p/829677#M1923</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-12T10:00:58Z</dc:date>
    </item>
  </channel>
</rss>

