I got a mathematical problem for designing icons, and I am looking for a JavaScript solution.

I take 2 circles, each a different radius and position, and a point. I want to know the smallest circle that contains the two circles and goes along the point.

*The red cirle is the circle I want to know*

In want a function like this:

```
function calculate(c1x, c1y, c1r, c2x, c2y, c2r, px, py){
//Calculation
return {
x: outX,
y: outY,
r: outR
};
}
```

Answer:1

There is a lot of degenerate cases: one circle is inside another and so on.

For the most general case - big circle touches both small ones and goes through the point - we need to solve a system of three equations for three unknowns `cx, cy, R`

:

```
(px - cx)^2 + (py - cy)^2 = R^2
(cx1 - cx)^2 + (cy1 - cy)^2 = (R-r1)^2
(cx2 - cx)^2 + (cy2 - cy)^2 = (R-r2)^2
```

You can try to solve it with paper and pencil or use some program for symbolic calculations like Maple, Mathematica, Matlab, MathCad etc.

P.S. to slightly simplify calculations, subtract point coordinates from all values, solve system

```
cx^2 + cy^2 = R^2
(cx1' - cx)^2 + (cy1' - cy)^2 = (R-r1)^2
(cx2' - cx)^2 + (cy2' - cy)^2 = (R-r2)^2
```

and add px, py to the result

Answer:2

In my Spring MVC project I am getting the one Boolean variable as a model attribute from the controller in my JSP view. based on the Boolean variable's value I have to execute the Js code. So I am ...

In my Spring MVC project I am getting the one Boolean variable as a model attribute from the controller in my JSP view. based on the Boolean variable's value I have to execute the Js code. So I am ...

- javascript comparison boolean
- equal javascript boolean
- comparing boolean javascript
- javascript comparing boolean values
- javascript boolean comparison not working

I am using - victorjonsson/jQuery-Form-Validator URL: https://github.com/victorjonsson/jQuery-Form-Validator I am validating a from, and using toggleDisabled feature. Form validate the input every ...

I am using - victorjonsson/jQuery-Form-Validator URL: https://github.com/victorjonsson/jQuery-Form-Validator I am validating a from, and using toggleDisabled feature. Form validate the input every ...

- validate input only numbers jquery
- validate input only numbers javascript
- validate input only numbers
- validate input only numbers js
- validate input only numbers angular
- php validate input only numbers
- jquery validate input integer only
- jquery validate input text only
- jquery validate input numeric only
- angularjs validate input only numbers
- jquery validate only input

I want to add one day to my date how can I do that my date is date = new Date(); date = new Date(); endDate = this.date.toString();

I want to add one day to my date how can I do that my date is date = new Date(); date = new Date(); endDate = this.date.toString();

- want that date
- i want to date that girl

Based on this question, I have created a custom anonymous event listener as follows: function init() { console.log("Initiating widgets"); } window.addEventListener("widgetInit", init()); I can ...

Based on this question, I have created a custom anonymous event listener as follows: function init() { console.log("Initiating widgets"); } window.addEventListener("widgetInit", init()); I can ...