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


Draw a Circle with Spokes

Posted on 1999-07-05
Medium Priority
Last Modified: 2006-11-17
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.
Question by:et1dkn
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
  • Learn & ask questions
  • 5
LVL 10

Accepted Solution

caraf_g earned 1200 total points
ID: 1522043
I put a sample for you in the following web site:
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.
LVL 10

Expert Comment

ID: 1522045
Option Explicit

Private Sub Command1_Click()


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)

End Sub

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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..)

Author Comment

ID: 1522047

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



LVL 10

Expert Comment

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction In a recent article ( 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

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question