Results 1 to 3 of 3
Thread: Graph maths
- 10-03-2012, 04:03 PM #1
Member
- Join Date
- Jul 2012
- Posts
- 33
- Rep Power
- 0
Graph maths
Hiya
I've got a problem that I suppose is more about maths than Java. I'm doing the cs106a Stanford online class, and am stuck thinking about how to represent a graph on a page, where the values of y goes up as you go down the page, and the values of the data goes up in the other direction. And the value of y is variable, because the window can be resized. There's also a bottom and a top margin to the graph on the window, so the top data value doesn't match precisely to 0 and the 0 data value doesn't map precisely to getHeight().
The max data value is 1000. So 1000 would always be at 0 + margin. And 0 data value would always be getHeight() - margin. Not sure how to go from there to calculating the point on the page for any value in between...
Cheers, R
- 10-03-2012, 04:19 PM #2
Re: Graph maths
I really don't know what you're asking, but I would suggest getting out a piece of paper and a pencil and drawing a bunch of different scenarios until you start to see a pattern.
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 10-03-2012, 04:30 PM #3
Member
- Join Date
- Jul 2012
- Posts
- 33
- Rep Power
- 0
Similar Threads
-
Confusion with maths game?...
By Bimz in forum New To JavaReplies: 8Last Post: 08-29-2011, 11:08 AM -
Help me with maths on my program!
By Ruuhkis in forum New To JavaReplies: 6Last Post: 02-17-2011, 06:27 AM -
Maths for programming
By ron2794 in forum New To JavaReplies: 3Last Post: 12-17-2010, 08:17 AM -
Maths Packages
By Anish in forum Advanced JavaReplies: 7Last Post: 11-27-2008, 06:46 AM -
Whats wrong with my maths???
By soc86 in forum New To JavaReplies: 4Last Post: 11-03-2008, 05:52 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks