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 8409769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:00:09+00:00 2026-06-10T00:00:09+00:00

What I’ve got is two circles on the stage, circ1 and circ2. circ1 has

  • 0

What I’ve got
is two circles on the stage, circ1 and circ2. circ1 has radius 60, and circ2 has radius 30.

circ2 can be dragged around the stage in playback.

What I want
is two lines connecting the circles by their common outer tangents. This is working towards turning an old poster into an interactive funbox. Here’s a link to the poster, it might help you understand what I mean (although for now I’m just going to worry about two circles on their own).

The problem:
I understand how to find common tangents with a pen and paper, but as soon as I try to conceive of how to put this into terms Flash might understand, my brain goes into meltdown. I have no idea how to make this happen using ActionScript.

What I have tried:
I’ve looked around, and this is the closest thing I can find to what I’m trying to achieve (example app is downloadable at the bottom of the page). The only difference is that this includes interior tangents, which I don’t need.

Unfortunately this source is written in Java, which, despite my best efforts, I don’t understand enough to port to AS3.

So far all I have managed to achieve on my own is to define Points for the center of each circle, and then realize that I can’t make flash solve equations for a variable. I then spent several hours Googling trying to figure out how to proceed from here.

Any help would be much appreciated, this is work for a school project that is due in the end of this week. I may have bitten off more than I can chew here, but it’s too late to turn back now.

Thanks in advance!

  • 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-06-10T00:00:12+00:00Added an answer on June 10, 2026 at 12:00 am

    Here’s working code that does what you describe for two circles – assuming the two circles are the same size. Otherwise it is an approximation, since it assumes the tangent points will be on a line perpendicular to that connecting the circle centers.

    var point1 : Point = new Point(100, 100);
    var point2 : Point = new Point(300, 50);
    var radius1 : int = 60;
    var radius2 : int = 30;
    
    // if you draw a line from the first circle origo to
    // the second origo, this is the angle of that line
    var ang : Number = Math.atan2(point2.y - point1.y, point2.x - point1.x);
    
    // find the first point on the circumference that is orthogonal
    // to the line intersecting the two circle origos
    var start1 : Point = new Point(point1.x + Math.cos(ang + Math.PI / 2) * radius1, 
                                   point1.y + Math.sin(ang + Math.PI/2)* radius1);
    var end1 : Point = new Point(point2.x + Math.cos(ang + Math.PI / 2) * radius2, 
                                 point2.y + Math.sin(ang + Math.PI/2)* radius2);
    
    // find the second point on the circumference that is orthogonal
    // to the line intersecting the two circle origos
    var start2 : Point = new Point(point1.x + Math.cos(ang - Math.PI / 2) * radius1, 
                                   point1.y + Math.sin(ang - Math.PI/2)* radius1);
    var end2 : Point = new Point(point2.x + Math.cos(ang - Math.PI / 2) * radius2,
                                 point2.y + Math.sin(ang - Math.PI/2)* radius2);
    
    // draw everything on the stage
    this.graphics.lineStyle(1, 0x0);
    this.graphics.drawCircle(point1.x, point1.y, radius1);
    this.graphics.drawCircle(point2.x, point2.y, radius2);
    
    this.graphics.moveTo(start1.x, start1.y);
    this.graphics.lineTo(end1.x, end1.y);
    
    this.graphics.moveTo(start2.x, start2.y);
    this.graphics.lineTo(end2.x, end2.y);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported

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.