Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

3 Point Arc

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-22-2008, 05:30 AM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 306
Default 3 Point Arc

Hi All

How can I in Basic4ppc define 2 points on the screen and then tap on the 3rd point and have an arc (part of a circle) follow the 3rd point as I move my stylus across the screen?

How do I draw an ellipse?

How can I zoom in, zoom out and pan my drawing. Remember that the drawing consists of lines, circles, etc that has been defined by coordinates.

By the way on a scale from 1 to 10, NSBasic gets 1 and basic4ppc gets 10! It's a great development platform. Just waiting to get back to South Africa, so that I can buy a copy and start compiling!

Thanks
Michael
Reply With Quote
  #2 (permalink)  
Old 05-22-2008, 06:14 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

1. You will need to manually draw the arc. There is no DrawArc method.
2. See ImageLib.DrawEllipse
3. You can store the drawings data and then redraw all the drawings in a different scale.
Reply With Quote
  #3 (permalink)  
Old 05-22-2008, 07:54 AM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
Awards Showcase
Beta Tester 
Total Awards: 1
Default aX2+bX+c !

Yes Basic4ppc is great. The other day I had to use VB2008 which was a struggle! Micro$oft have a way of making things so complicated. I gave up and went back to Basic4ppc!

As to drawing an arc, Im sure we could write a small routine to do it.

I think its a quadratic equation to make an arc.
Do u want to be able to plot 2 points and then have the 3rd point in between those two (representing the maxima or minima of the curve) ?
Could easily plot a quadratic through those with a FOR NEXT loop
Reply With Quote
  #4 (permalink)  
Old 05-22-2008, 08:15 AM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 306
Unhappy 3 Point Arc

Hi

Yes, I agree with you. I can program in Visual Studio, but what a battle and it slows the PPC down to a snails pace!

Coming back to the 3 Point Arc. Say I have picked up (Tachy Survey) 3 points on an existing bellmouth which has a radius of say 10m. In the field I will then pick up a point at the start, middel and end of the bellmouth. The bellmouth is not a full circle, but only part of it. I then want to tap on the "ARC" function in my program, tap on the 3 points and the program must then draw an arc (not a full circle) through those 3 points.

In visual studio one can define the midpoint, radius, color, start angle and end angle of the arc.

Do you think this is possible?

Excuse all my questions!

Thanks
Michael
Reply With Quote
  #5 (permalink)  
Old 05-22-2008, 08:36 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

If you are referring to Graphics.DrawArc then it is not supported on the .Net Compact Framework (which means it can only be used on the desktop).
Reply With Quote
  #6 (permalink)  
Old 05-22-2008, 02:39 PM
Senior Member
 
Join Date: Jul 2007
Location: Michigan Usa
Posts: 176
Awards Showcase
Beta Tester 
Total Awards: 1
Default

hi ceaser

this is what I use to draw an arc.






PHP Code:
Sub DrawArc
    x1 
Int(txtx1.Text)
    
y1 Int(txty1.Text)
    
x2 Int(txtx2.Text)
    
y2 Int(txty2.Text)
    
Int(txtr.Text)    
    If 
x2 y2 Then
        
For x2 To y2 Step -1
            x 
Round(x1 Cos(cPI 180))
            
Round(y1 Sin(cPI 180))
            
bmp.SetPixel(x,y,Color)
        
Next
    
Else
        For 
x2 To y2 Step 1
            x 
Round(x1 Cos(cPI 180))
            
Round(y1 Sin(cPI 180))
            
bmp.SetPixel(x,y,Color)
        
Next
    End 
If    
    
form1.DrawImage(bmp.Value,0,0)
    
form1.Refresh    
End Sub 
x1 and y1 represent center of arc
x2 represents starting angle
y2 represents ending angle
r represents radius

In a day or two depending on how fast I can document how to use what I have so far and then I will post it all in projects to see if there is any interest in trying make it better then what it is at present.

I also uploaded a screen capture of a doodle to show what the arcs look like.
Attached Files
File Type: zip Arc.zip (16.3 KB, 40 views)
__________________
Using 6.90
dennishea
Reply With Quote
  #7 (permalink)  
Old 05-22-2008, 05:10 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
Awards Showcase
Beta Tester 
Total Awards: 1
Default like the picture lol!

Just a point not great to have x2 y2 representing the angles as x1,y1 are co-ordinates {as expected}.

having x1,y1 as coords and a1,a2 as the angles would be clearer.

Also why do you draw these points to a bitmap then draw that rather than just plotting them to a form?
Reply With Quote
  #8 (permalink)  
Old 05-22-2008, 05:13 PM
ceaser's Avatar
Basic4ppc Veteran
 
Join Date: May 2008
Location: Paarl, South Africa
Posts: 306
Default

Hi Dennishea

Thanks a million! It just shows what can be done, if one just uses one's grey matter a bit.

Thanks Again
Michael
Reply With Quote
  #9 (permalink)  
Old 05-22-2008, 05:36 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
Awards Showcase
Beta Tester 
Total Awards: 1
Default heres my solution

Sub Draw_Arc(x,y,r,a1,a2,color) 'Angles are in Radians

s = 1/r
For i=a1 To (a2-s) Step s
form1.line(x+r*Cos(i),y+r*Sin(i),x+r*Cos(i+s),y +r*Sin(i+s),color)
Next

End Sub

Last edited by colin9876 : 05-22-2008 at 05:49 PM.
Reply With Quote
  #10 (permalink)  
Old 05-22-2008, 05:39 PM
Senior Member
 
Join Date: Jul 2007
Location: Michigan Usa
Posts: 176
Awards Showcase
Beta Tester 
Total Awards: 1
Default

ceaser

Here is what I have started. Hopefully some of the better programers will look at and give some critisum that I can learn from. Like what colin9876 pointed out.

Thanks colin9876.



http://www.basic4ppc.com/forum/open-...html#post12829
__________________
Using 6.90
dennishea
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixed Point Math im4retro Questions (Windows Mobile) 3 05-31-2008 07:13 AM
Ticks as a floating point value on XP (not 2000) lancaster Questions (Windows Mobile) 4 04-09-2008 11:38 AM


All times are GMT. The time now is 09:54 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0