Degrees to Radians - Grasshopper2024-03-29T01:49:56Zhttps://www.grasshopper3d.com/forum/topics/degrees-to-radians?commentId=2985220%3AComment%3A185930&feed=yes&xn_auth=noOk, thanks!tag:www.grasshopper3d.com,2011-03-16:2985220:Comment:1862272011-03-16T19:58:06.924ZMårten Nettelbladthttps://www.grasshopper3d.com/profile/MNettelbladt
Ok, thanks!
Ok, thanks! Darn, I forgot to add the lev…tag:www.grasshopper3d.com,2011-03-16:2985220:Comment:1859302011-03-16T11:54:04.193ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>Darn, I forgot to add the level-1 expression parsing to those input boxes when I rewrote the system a few months ago. You're supposed to be able to use placeholder codes for weird characters like the degree symbol or the pi symbol, but they don't work. I'm fixing it now.</p>
<p> </p>
<p>Here's the total list of placeholders and what they convert into:</p>
<p> </p>
<p>'Operators </p>
<p>code.Replace("**", "┴") </p>
<p>code.Replace("<cross>", "┴") …</p>
<p>Darn, I forgot to add the level-1 expression parsing to those input boxes when I rewrote the system a few months ago. You're supposed to be able to use placeholder codes for weird characters like the degree symbol or the pi symbol, but they don't work. I'm fixing it now.</p>
<p> </p>
<p>Here's the total list of placeholders and what they convert into:</p>
<p> </p>
<p>'Operators </p>
<p>code.Replace("**", "┴") </p>
<p>code.Replace("<cross>", "┴") </p>
<p>code.Replace("<crossproduct>", "┴") </p>
<p>code.Replace("<outer>", "┴")</p>
<p>code.Replace("<d>", "°") </p>
<p>code.Replace("<deg>", "°") </p>
<p>code.Replace("<degrees>", "°")</p>
<p>code.Replace("<2>", "²") </p>
<p>code.Replace("<square>", "²") </p>
<p>code.Replace("<3>", "³") </p>
<p>code.Replace("<cube>", "³")</p>
<p>code.Replace("<project>", "↓") </p>
<p>code.Replace("<pull>", "↓") </p>
<p>code.Replace("<push>", "↑") </p>
<p>code.Replace("<dist>", "↔") </p>
<p>code.Replace("<distance>", "↔")</p>
<p>code.Replace("!=", "≠") </p>
<p>code.Replace("<>", "≠") </p>
<p>code.Replace("<=", "≤") </p>
<p>code.Replace("=<", "≤") </p>
<p>code.Replace(">=", "≥") </p>
<p>code.Replace("=>", "≥")</p>
<p>code.Replace("<almost>", "≈") </p>
<p>code.Replace("<almostequal>", "≈") </p>
<p>code.Replace("<approx>", "≈", ) </p>
<p>code.Replace("<approximately>", "≈") </p>
<p>code.Replace("<similar>", "≈") </p>
<p>code.Replace("~", "≈")</p>
<p>'Functions </p>
<p>code.Replace("<sum>", "∑") </p>
<p>code.Replace("<sumtotal>", "∑") </p>
<p>code.Replace("<summate>", "∑")</p>
<p>code.Replace("<prod>", "∏") </p>
<p>code.Replace("<product>", "∏")</p>
<p>code.Replace("<average>", "Ā") </p>
<p>code.Replace("<mean>", "Ā")</p>
<p>code.Replace("<hmean>", "Ū") </p>
<p>code.Replace("<harmonic>", "Ū") </p>
<p>code.Replace("<harmonicmean>", "Ū")</p>
<p>code.Replace("<gmean>", "Ġ") </p>
<p>code.Replace("<geometric>", "Ġ") </p>
<p>code.Replace("<geometricmean>", "Ġ")</p>
<p>'constants </p>
<p>code.Replace("<pi>", "π") </p>
<p>code.Replace("<phi>", "φ") </p>
<p>code.Replace("<inf>", "∞") </p>
<p>code.Replace("<infinity>", "∞")</p>
<p>code.Replace("<1/2>", "½") </p>
<p>code.Replace("<0.5>", "½") </p>
<p>code.Replace("<half>", "½")</p>
<p>code.Replace("<1/4>", "¼") </p>
<p>code.Replace("<0.25>", "¼") </p>
<p>code.Replace("<quarter>", "¼")</p>
<p>code.Replace("<3/4>", "¾") </p>
<p>code.Replace("<0.75>", "¾") </p>
<p>code.Replace("<threequarters>", "¾")</p>
<p>code.Replace("<1/3>", "⅓") </p>
<p>code.Replace("<third>", "⅓")</p>
<p>code.Replace("<2/3>", "⅔") </p>
<p>code.Replace("<twothirds>", "⅔")</p>
<p> </p>
<div style="float: left; white-space: pre; line-height: 1; background: #FFFFFF;"><p style="line-height: 1; white-space: pre;"><span class="sc0">So you should be able to write:</span></p>
<span style="line-height: 1; white-space: pre;"><br />
</span><br />
<p style="line-height: 1; white-space: pre;"> </p>
<p style="line-height: 1; white-space: pre;"><em><span class="sc0">45<deg></span></em></p>
<p style="line-height: 1; white-space: pre;"> </p>
<p style="line-height: 1; white-space: pre;"><span class="sc0">--</span></p>
<p style="line-height: 1; white-space: pre;"><span class="sc0">David Rutten</span></p>
<p style="line-height: 1; white-space: pre;"><span class="sc0">david@mcneel.com</span></p>
<p style="line-height: 1; white-space: pre;"><span class="sc0">Poprad, Slovakia</span></p>
</div> Hi David, how can I do this i…tag:www.grasshopper3d.com,2011-03-15:2985220:Comment:1853412011-03-15T22:45:46.530ZMårten Nettelbladthttps://www.grasshopper3d.com/profile/MNettelbladt
<p>Hi David, how can I do this in a component? When I press Alt (to type Alt+0176) the dialog closes. Is there another way to enter it? Thanks.</p>
<p><a target="_self" href="http://storage.ning.com/topology/rest/1.0/file/get/2768643879?profile=original"><img class="align-full" width="596" src="http://storage.ning.com/topology/rest/1.0/file/get/2768643879?profile=original"/></a></p>
<p>Hi David, how can I do this in a component? When I press Alt (to type Alt+0176) the dialog closes. Is there another way to enter it? Thanks.</p>
<p><a target="_self" href="http://storage.ning.com/topology/rest/1.0/file/get/2768643879?profile=original"><img class="align-full" width="596" src="http://storage.ning.com/topology/rest/1.0/file/get/2768643879?profile=original"/></a></p> cooltag:www.grasshopper3d.com,2011-03-15:2985220:Comment:1854292011-03-15T22:40:49.653Zghotiohttps://www.grasshopper3d.com/profile/ghotio
cool
cool You can even use the degree s…tag:www.grasshopper3d.com,2011-03-15:2985220:Comment:1852802011-03-15T22:37:40.191ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>You can even use the degree symbol to convert a number from degrees to radians. So:</p>
<p> </p>
<p>45º</p>
<p> </p>
<p>becomes</p>
<p> </p>
<p>1.7671458676442586966352369030947</p>
<p> </p>
<p>I find it more readable that way.</p>
<p> </p>
<p>--</p>
<p>David Rutten</p>
<p>david@mcneel.com</p>
<p>Poprad, Slovakia</p>
<p>You can even use the degree symbol to convert a number from degrees to radians. So:</p>
<p> </p>
<p>45º</p>
<p> </p>
<p>becomes</p>
<p> </p>
<p>1.7671458676442586966352369030947</p>
<p> </p>
<p>I find it more readable that way.</p>
<p> </p>
<p>--</p>
<p>David Rutten</p>
<p>david@mcneel.com</p>
<p>Poprad, Slovakia</p> Thanks for the reply. I was a…tag:www.grasshopper3d.com,2011-03-15:2985220:Comment:1851692011-03-15T20:12:09.480ZMoniquehttps://www.grasshopper3d.com/profile/TealWindow
Thanks for the reply. I was aware of numerous ways of converting degrees to radians. I just wanted to provide a shorter-shortcut. ;)
Thanks for the reply. I was aware of numerous ways of converting degrees to radians. I just wanted to provide a shorter-shortcut. ;) Hi Monique,
Thank you for s…tag:www.grasshopper3d.com,2011-03-15:2985220:Comment:1853152011-03-15T19:49:46.747ZDanny Boyeshttps://www.grasshopper3d.com/profile/DannyBoyes
<p>Hi Monique,</p>
<p> </p>
<p>Thank you for sharing. Also be aware that there is a function that you can use in the expressions that allows you to do this as well. rad() will convert degrees to radians and deg() will convert radians to degrees.</p>
<p>Below I've shown the example using the Fx component but it can be put into any input's expression where you might want to have degrees as the input but GH needs radians.…</p>
<p></p>
<p>Hi Monique,</p>
<p> </p>
<p>Thank you for sharing. Also be aware that there is a function that you can use in the expressions that allows you to do this as well. rad() will convert degrees to radians and deg() will convert radians to degrees.</p>
<p>Below I've shown the example using the Fx component but it can be put into any input's expression where you might want to have degrees as the input but GH needs radians.</p>
<p><a target="_self" href="http://storage.ning.com/topology/rest/1.0/file/get/2768644131?profile=original"><img class="align-full" width="721" src="http://storage.ning.com/topology/rest/1.0/file/get/2768644131?profile=RESIZE_1024x1024"/></a></p>