Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Draw a Circle with Spokes

Posted on 1999-07-05
Medium Priority
550 Views
Win95/VB5 Pro:
I want to draw a Circle with radius of any length. Then use Line function to draw spokes(radius) at every 10 or 20 degrees (programmable).  I understand that this is math oriented but wonder if anyone can help.
0
Question by:et1dkn
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 5

LVL 10

Accepted Solution

caraf_g earned 1200 total points
ID: 1522043
I put a sample for you in the following web site:

homepage.tinet.ie/~carafa/VBSamples/Spokes.zip
0

LVL 10

Expert Comment

ID: 1522044
I hope this works for you - I have VB5 Enterprise edition. If not, it just contains a simple form with
1 button
1 text box
1 label saying "Spokes"

The idea is that you enter the number of spokes in the text box and then hit the button which will draw the requested circle with spokes. Leave the top left of the form blank so there is space for the circle to be displayed.

The code in the form module follows in the next comment.
0

LVL 10

Expert Comment

ID: 1522045
Option Explicit

Private Sub Command1_Click()

Me.Cls

Dim Pi As Double
Dim intSpokes As Integer
Dim intCount As Integer

intSpokes = Val(Text1.Text)

Pi = 3.141592653

Me.Circle (1000, 1000), 1000

Dim dblX As Double
Dim dblY As Double

For intCount = 0 To intSpokes - 1
dblX = 1000 * Cos(intCount * ((2 * Pi) / intSpokes))
dblY = 1000 * Sin(intCount * ((2 * Pi) / intSpokes))
Me.Line (1000, 1000)-(1000 + dblX, 1000 + dblY)
Next

End Sub

0

LVL 10

Expert Comment

ID: 1522046
(You only need to worry about those last two comments if you can't download the .zip file from the site, or if it won't work in VB5 prof..)
0

Author Comment

ID: 1522047
C:

Thanks much for your quick answer...been a LONG time since my last Geometry class..Thanks for breaking the log jam.

Respects

Dan

0

LVL 10

Expert Comment

ID: 2096532
The zip file has been removed from my homepage
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
###### Suggested Courses
Course of the Month6 days, 23 hours left to enroll