draw series of point into form
-
hi all i want to draw some couple of point into form(or picture box). sample coordinates for some points are following
PointNo----- X----- Y 1----- 0.4064 ----- 7.4848 2----- 2.5184 ----- 7.4848 3----- 6.3904 ----- 7.4144 4----- 9.5584 ----- 7.344 5----- 5.44E-02----- 4.176 6----- 2.8704 ----- 3.8944 7----- 6.9536 ----- 4.3168 8----- 9.7696 ----- 3.6128 9----- 1.1104 ----- 1.2896 10----- 5.616 ----- 1.0784 11----- 9.84 ----- 0.8672 12----- -1.05 ----- 8.603703704 13----- 2.209259259----- 8.603703704 14----- 7.994444444----- 8.685185185 15----- 10.60185185----- 8.603703704 16----- -1.05 ----- -0.603703704 17----- 5.142592593----- -0.603703704 18----- 10.68333333----- -0.359259259 19----- -3.16347308----- 10.54256687 20----- 2.377079047----- 10.3067987
Problem is that some value is negative and so small. So how can i draw the point on form which contains negative value. simply i want to ask that how can i calculate scale for X and Y axis so all of my point is easily visible on form or picture box. -
hi all i want to draw some couple of point into form(or picture box). sample coordinates for some points are following
PointNo----- X----- Y 1----- 0.4064 ----- 7.4848 2----- 2.5184 ----- 7.4848 3----- 6.3904 ----- 7.4144 4----- 9.5584 ----- 7.344 5----- 5.44E-02----- 4.176 6----- 2.8704 ----- 3.8944 7----- 6.9536 ----- 4.3168 8----- 9.7696 ----- 3.6128 9----- 1.1104 ----- 1.2896 10----- 5.616 ----- 1.0784 11----- 9.84 ----- 0.8672 12----- -1.05 ----- 8.603703704 13----- 2.209259259----- 8.603703704 14----- 7.994444444----- 8.685185185 15----- 10.60185185----- 8.603703704 16----- -1.05 ----- -0.603703704 17----- 5.142592593----- -0.603703704 18----- 10.68333333----- -0.359259259 19----- -3.16347308----- 10.54256687 20----- 2.377079047----- 10.3067987
Problem is that some value is negative and so small. So how can i draw the point on form which contains negative value. simply i want to ask that how can i calculate scale for X and Y axis so all of my point is easily visible on form or picture box.sunil goyalG wrote:
simply i want to ask that how can i calculate scale for X and Y axis so all of my point is easily visible on form or picture box.
It's simple gradeschool math. Get the highest and lowest values in each axis. This gives you the bounds of the graph. Then it's a simple matter of dividing by the available space to get your scaling values. Multiple each point by the scale value and you've got your graph.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008