Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6794657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:14:54+00:00 2026-05-26T18:14:54+00:00

Now I am doing this in VB6 but I don’t think it matters what

  • 0

Now I am doing this in VB6 but I don’t think it matters what I do it in, does it? I believe it has to do with math.

Here is the problem, have a look at this picture

enter image description here

As you can see in this image, there is a black line and a grey circle. I want the circle to move from the bottom left to the bottom right, but I also want it to stay along the path of the line so it reaches our second picture like this:

enter image description here

Now how can I accomplish this? Again, using VB6.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:14:55+00:00Added an answer on May 26, 2026 at 6:14 pm

    Ok, I don’t know VBA6 but, since you said:

    I don’t think it matters what I do it in

    I will give a generic solution that involves you having the center of the circles coordinates, and the lines endpoints.

    This line can be treated as a vector:

     (line.x2-line.x1, line.y2-line.y1)
    

    You don’t need to write this in your program or anything just saying it is a vector.

    What you do need to is get the magnitude of the vector and assign it to a variable:

    unitSize = sqrt((line.x2-line.x1)^2 + (line.y2-line.y1)^2)
    

    Now make it into unit vector components and get the separate components:

    unitX = (line.x2-line.x1)/unitSize
    unitY = (line.y2-line.y1)/unitSize
    

    Now how ever you update the circle:

    do {
        circle.x = circle.x + unitX * incrementSize //incrementSize scales how big the movement is assign it to whatever you seem fit.
        circle.y = circle.y + unitY * incrementSize
    until (circle.x >= line.x2) //Or <= line.x2 depends which way you are going.
    

    Hopefully this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I'm doing this but it seems to not work right. Thanks for
I'm now doing it this way: $form.find(':input') But how do exclude those disabled elements?
I'm now doing it this way: <a title=<?php echo $title; ?>>... But it will
So right now I'm doing this: $(.radio_visible).hide().removeClass(radio_visible); But what I'd like to be able
I'm now doing this: rewriterule ^jobs/([0-9]+)/.* job.php?id=$1 Which will erase parameters in jobs/1010/title?k=v How
Right now I'm doing this: SELECT * FROM messages WHERE location_id = 7 AND
Right now I'm doing something like this: RewriteRule ^/?logout(/)?$ logout.php RewriteRule ^/?config(/)?$ config.php I
I'm currently doing something like this in some code I'm working on right now:
What is the most efficient way to do this? Right now I am doing
I have a VB6 application (please don't laugh) which does a lot of drawing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.