# How should I write this mathematical definition in rhinoscript

**URL:** <https://discourse.mcneel.com/t/how-should-i-write-this-mathematical-definition-in-rhinoscript/127330>\
**Category:** Scripting\
**Tags:** windows\
**Created:** [July 12, 2021, 7:23pm UTC](https://discourse.mcneel.com/t/how-should-i-write-this-mathematical-definition-in-rhinoscript/127330 "2021-07-12T19:23:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![claudiofeldman](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/claudiofeldman/32/486061_2.png) [@claudiofeldman](https://discourse.mcneel.com/u/claudiofeldman)\
**Post date:** [July 12, 2021, 7:23pm UTC](https://discourse.mcneel.com/t/how-should-i-write-this-mathematical-definition-in-rhinoscript/127330/1 "2021-07-12T19:23:17Z")

</div>

How should I write this mathematical definition in rhinoscript  
so that it works and to be able to see the graph on the Rhino screen?  
{(u, v) | 0 ≤ u ≥ 2π, 0 ≤ v ≥ π}  
x = sin (v) cos (u)  
y = sin (v) sin (u)  
z = cos (v)

It is to obtain a geometric shape  
from that mathematical formula … but it always gives me an error.  
Help  
Thanks

---

<div class="post-metadata">

**Author:** ![kev.r](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/kev.r/32/766021_2.png) [@kev.r](https://discourse.mcneel.com/u/kev.r)\
**Post date:** [July 12, 2021, 9:34pm UTC](https://discourse.mcneel.com/t/how-should-i-write-this-mathematical-definition-in-rhinoscript/127330/2 "2021-07-12T21:34:26Z")

</div>

For future reference, it would be easier to help if you would provide the code you are using and show the error message you are getting.

This is one way to solve this in grasshopper (with components and python):

 ![math_definition_re](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/4/b/9/4b9df735cf4641fa6fbd8238b2f16b82ef7a1076.jpeg)

[math\_definition\_re.gh](https://discourse.mcneel.com/uploads/short-url/2rKA9FYCAtT5u36B9SIFZwn2195.gh) (8.5 KB)

This could be simplified since your u-value is 2 times your v-value, but I left it as is to allow using different values for u and v.

-Kevin

---

<div class="post-metadata">

**Author:** ![claudiofeldman](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/claudiofeldman/32/486061_2.png) [@claudiofeldman](https://discourse.mcneel.com/u/claudiofeldman)\
**Post date:** [July 31, 2021, 7:43pm UTC](https://discourse.mcneel.com/t/how-should-i-write-this-mathematical-definition-in-rhinoscript/127330/3 "2021-07-31T19:43:57Z")

</div>

Thanks!  
…………
