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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:59:02+00:00 2026-06-16T04:59:02+00:00

Given: A point P, circle 1 and circle 2’s positions and radii What is:

  • 0

Given:

A point P, circle 1 and circle 2’s positions and radii

What is:

The equation for T, the ‘mix level’ between color 1 and 2 (a value between 0 to 1)

Many radial gradient equations only apply to concentric circles or circles that share a position. I’m looking for something that matches the image below, created using Quartz (Core Graphics). I am writing a GLSL shader, but I need to understand the math first.

enter image description here

  • 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-16T04:59:03+00:00Added an answer on June 16, 2026 at 4:59 am

    If this is in 2D, then you can write the parameters of the circle that your point lies on as:

    x3=T*x1+(1-T)*x2
    y3=T*y1+(1-T)*y2
    r3=T*r1+(1-T)*r2
    

    EDIT: Of course, that circle can be represented as:

    (x3-xP)^2+(y3-yP)^2=r3^2
    

    You can substitute the first 3 equations into the last (and remember that (xP, yP) is your point) to get 1 equation with only T as a variable that is quadratic in T, so it is easy to solve for T. Doing so gives us:

    T=(-r2*(r1-r2)+(x1-x2)*(x2-xP)+(y1-y2)(y2-yP)
        {+-}sqrt(r2^2*((x1-xP)^2+(y1-yP)^2)-2*r1*r2*((x1-xP)*(x2-xP)
                   +(y1-yP)*(y2-yP))+r1^2*((x2-xP)^2+(y2-yP)^2)
                   -(x2*y1-xP*y1-x1*y2+xP*y2+x1*yP-x2*yP)^2))
     /((r1-r2)^2-(x1-x2)^2-(y1-y2)^2)
    

    I know that that is a bit hard to read, but it is not actually that bad mathematically. It is just addition, multiplication, and squaring (which is really just multiplication).

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

Sidebar

Related Questions

I can draw a circle around a given point (x,y) with a command like
Given a circle with a known center point and two points on the circle
I am given a circle with radius R and its centre in the point
I need to have all point coordinates for a given circle one after another,
I have a circle around a given point, call this point (x1, y1). I
Given a point (pX, pY) and a circle with a known center (cX,cY) and
I'm trying to find rows which are within ____meters from the given point. THis
For given floating point numbers x and a , I would like to compute
Given a floating point number, I'm looking to get a String representation of a
Given a table where the first column is seconds past a certain reference point

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.