Math module? Where is the information in API
-
Is it that I'm blind or what?
I've read: ....As mentioned previously, Ruby provides an extensive range of math related methods. This is in some information on the internet. But I can't find anything in Google SketchUp Ruby API, or anywhere in the documentation.
Could someone please point me to a list of all Math related methods and constants in the API?
Very much appreciated. -
This is a list of most functions outside of Skethcup's own...
http://www.ruby-doc.org/docs/ProgrammingRuby/html/builtins.htmlMath functions are here...
http://www.ruby-doc.org/core/classes/Math.htmlAlso
Math::PI
give 'pi' andrand
gives a random number 0 to 1 orrand(5)
1,2,3,4 or 5This site has most available standard Ruby Modules, Classes and Methods...
-
@tig said:
Math functions are here...
http://www.ruby-doc.org/core/classes/Math.htmlThat's the 1.9 docs - 1.8.6 is here: http://www.ruby-doc.org/core-1.8.6/classes/Math.html
1.9 docs lists many methods and classes that doesn't exist in 1.8. -
...AND as thomthom points out Sketchup uses the older Ruby 1.8 version and not the current 1.9...
Sorry for the mis-link... however, I suspect that you will hardly be using anything more than the most basic sin/cos/tan/sqrt etc anyway... -
Thanks TIG and Thomas.
I noticed the newer version, yes. But what a relief, these list
Much better than the few I had mentioned in the short list I had.
Thought I was going insane, running around in circles. -
The index page for the 1.8.6 docs: http://www.ruby-doc.org/core-1.8.6/
-
@unknownuser said:
Now I get it! thanks- i had no idea sketchup used the old version
So it seems this was the only thing that bothered you. Good.
Advertisement