Line intersection without endpoints - geometry

I need to determine whether two lines intersect, but these lines have only starting points. (So that's why this is different from similar questions asked about line intersection).
The lines are defined as y = dx + a, with d being the gradient. Both lines start in different starting points (x,y).

just find the point where line 1 y equates line 2 y say line 1: y = d1*x+a1 and line 2: y = d2x + a2. You just need to find x for when y in both lines are equal: d1x + a1 = d2x + a2 and then solve for x.

Related

what does E represent in microsoft Excel?

Excel has just output this trendline: y = 0.032x4 - 5608.x3 + 4E+08x2 - 1E+13x + 1E+17
How can I convert this equation into a useable form without the E's.
(how do you interpret these E's)
You can use the trendline from a graph in an equation, but, in addition to translating it correctly, you need to also format the trendline to show a maximum number of decimals (e.g 15), else your results will not be congruent with the graph.
Your formula would translate into something like:
y = 0.032*(x^4) - 5608*(x^3) + 4E+08*(x^2) + 1E+13*(x) + 1E+17
4E+08 will be interpreted by Excel as being 4*10^8 or 400,000,000. You don't have to do that yourself,
However, unless you have a very old version of Excel, where the LINEST function did not work properly, it is usually simpler to just use worksheet functions for that purpose.
For example, if this is a line graph where y is your range of y-values; your trendline is a 4th order polynomial, and your x-axis is just serial numbers 1..n, you could use:
=LINEST($A$4:$A$12,SEQUENCE(COUNT(y))^{1,2,3,4})
to return your sequence of m values.
And to return a point along the curve, you could use
=SUM(LINEST($A$4:$A$12,SEQUENCE(COUNT(y))^{1,2,3,4})*A4^{4,3,2,1,0})
where A4 represents a new_x value.
If you don't have the SEQUENCE function, there are a variety of other functions that can be used to generate a sequence of values; or you can just select your known_x's (which you would have to do anyway if they are not sequential {1..n})
The Scientific format displays a number in exponential notation,
replacing part of the number with E+n, in which E (exponent)
multiplies the preceding number by 10 to the nth power. For example, a
2-decimal scientific format displays 12345678901 as 1.23E+10, which is
1.23 times 10 to the 10th power.
Before
y = 0.032x4 - 5608.x3 + 4E+08x2 - 1E+13x + 1E+17
After
y = 0.032x4 - 5608.x3 + 4 x 10^8x * 2 - 1 * 10^13x + 1 * 10^17
Basically really large numbers,4 x 10^8x*2=400000000x*2, 1 x 10^13x=10000000000000x, 1E+17=100000000000000000

what is the right formula to calculate the crossing point of 2 lines, while having only the points associated to the lines?

what is the formula for calculating the crossing point of 2 lines when the input is the coordination of the lines - using excel formula for X and Y.
i can calculate each line function - but how to compare the two functions to calculate the crossing point ?
Try this one:
EDIT: Lines defined by points (A1,A2) -> (A3,A4) and (B1,B2) -> (B3,B4)
Let the lines follow a system of linear equations:
y1=m1x1+c1 or y=(A4-A2)/(A3-A1)*x + A2-(A4-A2)/(A3-A1)*A1
so m1=(A4-A2)/(A3-A1) and c1=A2-(A4-A2)/(A3-A1)*A1
y2=m2x2+c2 or y=(B4-B2)/(B3-B1)*x + B2-(B4-B2)/(B3-B1)*B1
so m2=(B4-B2)/(B3-B1) and c2=B2-(B4-B2)/(B3-B1)*B1
Where:
m1: Gradient or Slope of line1
c1: Intercept of line1
m2: Gradient or Slope of line2
c2: Intercept of line2
The intersection point will be (u,v). They must satisfy the above 2 equations.
v=m1u+c1
v=m2u+c2
Then m1u+c1=m2u+c2 so:
u= (c2-c1)/(m1-m2)
v=m1*u+c1
Use SLOPE and INTERCEPT functions to replicate these equations in Excel:
u=(INTERCEPT(y-values2,x-values2)-INTERCEPT(y-values1,x-values1))/(SLOPE(y-values1,x-values1)-SLOPE(y-values2,x-values2))
v =SLOPE(y-values1,x-values1)*X+INTERCEPT(y-values1,x-values1)
Hope it helps!

How do I return results to several cells?

Excel sheet to be filled with three results:
I have the following code (simplified to explain my problem):
Public Function addieren(X, Y, Z, value) As Double
' function to calculate three results
' and to write these in three fields starting with
' the field calling the macro
Xa = X + value
Ya = Y + value
Za = Z + value
addieren = Za
End Function
The current version of course writes Xa to the field. How can I manage to write the three resulting values into three subsequent cells, starting with the one calling the function?
Z = Z + value
addieren = Z
End Function
The reason for returning only one value in your code seems to be the line “addieren = z” as the returned value equals the result of that equation. But how about the remaining result values for Y and X?
also not working: I tried the array method when entering the formula (having three cells activated and hitting cmd-Enter). In that case I get three values but not based on the proper input values (shifted by one column each).

Search and replace certain X,Y pairs in a set of X Y Z coordinates

I have a EXCEL table consisting of a list of 100 points with the coordinates X Y Z. I want to find and replace certain X and Y coordinates, not just the X coordinate.
For example in the picture below,
I want to find all the points in my table which have X=1 , Y=2 and replace with X=9, Y=9 . Not just find X=1 and replace with X=9 Because is has to match both X and Y coordinates.
First, get your X+Y columns together . lets say your info is found on columns a+b then you can concatenate them together for d2 insert:
=a2&","&a3
Now drug it to the bottom of your data.
select column d and copy it then paste special on the same place with values.
After that you can just replace with simple replace ( ctrl+f) all the pairs you wish.
When you done, you can extract this back to 2 columns with date ribbon -> text to column (with delimiter.)

Find the position of a circle tangent to two other circles

Say there are 3 circles, A, centered at point a, B centered at point b, and C, centered at point c. Each has a known radius independent of the others, Ar, Br, and Cr. The positions of a and b are known, but the position of c isn't.
The distance between a and b will always be between (Ar + Br) and (Ar + Br + (2 * Cr)).
I'm looking for a pseudo-code algorithm to find the position of c so that circles A and C are tangent, and circles B and C are tangent. There ought to be two solutions unless a and b are at their maximum allowed distance, in which case there would only be one.
Thank you, any help is much appreciated.
"Inflate" the circles A and B by Rc at the same time as you shrink C to a single point. Then the center of C appears as the intersection of the two inflated circles.
Write the implicit equation of the two circles and subtract one from the other; the quadratic terms cancel out, leaving the equation of a straight line (the line through the two intersection points).
(X-Xa)² + (Y-Ya)² = (Ra+Rc)²
(X-Xb)² + (Y-Yb)² = (Rb+Rc)²
=> by subtraction
(Xa-Xb)(2X-Xa-Xb) + (Ya-Yb)(2Y-Ya-Yb) = (Ra-Rb)(Ra+Rb+2Rc)
To solve this, you can express Y as a function of X using the linear relation, then substitute Y in the equation of one of the circles and solve the second degree equation in X, yielding two solutions.

Resources