Calculate place of point C to be equal distance away from points A and B - trigonometry

In the picture below I have a triangle. It represents a mechanical arm, where
A = Shoulder (base point of the object)
B = Hand (turret that shoots at the player)
C = Elbow
x = Upper arm (same length as z)
y = Distance between Shoulder and Hand
z = Lower arm (same length as x)
Point B can freely move around point A as long as it doesn't go too far away (pre-determined value). The position of point C should be calculated so that the lines x and z doesn't suffer any changes in length. In other words, point C has to stay a pre-determined distance away from points A and B. How should I calculate this?

First observation (you can't overstretch and you can't touch your shoulder if your under arm is shorter than your upper arm):
| x - z | <= | y | <= | x + z |
Next, it can be calculated with the cosine rule, where you can calculate any angle you want (e.g. angle a = CAB).
From there you can calculate C.

Related

How to solve two balls select event without replacement

Q)A box contains 4 red balls, 3 green balls and 3 blue balls. Two balls are selected at
random without replacement. Let X represent the number of red balls in the sample and
Y the number of green balls in the sample.
a) Arrange the different pairs of values of (X, Y ) as the cells in a table, each cell being
filled with the probability of that pair of values occurring, i.e. provide the joint
probability distribution.
b) What does the random variable Z = 2 - X - Y represent?
c) Calculate Cov(X, Y ).
d) Calculate P(X = 1 | -2 < X - Y < 2).
I couldn't understand how to think to solve the part a) in this question and so on.
To solving this question first of all you have to create a tree with this two events. First data in this question is that we can take is , these are not independent event. so you can create tree like this,
In first part you have to create the joint table of X and Y.
there is 0,1,2 are the only possible values that each variable can get.
The critical situations are that X-1 , Y-0 and X-0 , Y-1 .Because they got two possible chances in same situation that one color ball take first and that same color ball select the second time.
So this is the table that can get according to this tree.
part b represent the blue balls in selected sample

how to interpret coefficients in log-log market mix model

I am running a multivariate OLS regression as below using weekly sales and media data. I would like to understand how to calculate the sales contribution when doing log transforms like log-linear, linear-log and log-log.
For example:
Volume_Sales = b0 + b1.TV_GRP + b2.SocialMedia + b3.PaidSearch + e
In this case, the sales contributed by TV is b1 x TV_GRPs (coefficient multiplied by the TV GRP of that month)
Now, my question is: How do we calculate sales contribution for the below cases:
Log-Linear: ln(Volume_Sales) = b0 + b1.TV_GRP + b2.SocialMedia + b3.PaidSearch + e
Linear-Log: Volume_Sales = b0 + b1.TV_GRP) + b2. ln(SocialMedia) + b3. ln(PaidSearch) + e
Log-Log: *ln(Volume_Sales) = b0 + b1.TV_GRP) + b2. ln(SocialMedia) + b3. ln(PaidSearch) + e**
In general terms, a log transformation takes something that acts on the multiplicative scale and re-represents it on the additive scale so certain mathematical assumptions hold: among them, linearity. So to step beyond the "transform data we don't like" paradigm that many of us are guilty of, I like thinking in terms of "does it make most sense if an effect to this variable is additive (+3 units) or multiplicative (3 times as much, 20% reduction, etc)?" That and your diagnostic plots (residual, q-q, etc.) will do a good job of telling you what's the most appropriate in your case.
As for interpreting coefficients, here are some ways I've seen it done.
Linear: y = b0 + b1x + e
Interpretation: there is an estimated b1-unit increase in the mean of y for every 1-unit increase in x.
Log-linear: ln(y) = b0 + b1x + e
Interpretation: there is an estimated change in the median of y by a factor of exp(b1) for every 1-unit increase in x.
Linear-log: y = b0 + b1ln(x) + e
Interpretation: there is an estimated b1*ln(2)-unit increase in the mean of y when x is doubled.
Log-log: ln(y) = b0 + b1ln(x) + e
Interpretation: there is an estimated change in the median of y by a factor of 2^b1 when x is doubled.
Note: these can be fairly readily derived by considering what happens to y if you replace x with (x+1) or with 2x.
These generic-form interpretations tend to make more sense with a bit of context, particularly once you know the sign of the coefficient. Say you've got a log-linear model with an estimated b1 of -0.3. Exponentiated, this is exp(-0.3)=0.74, meaning that there is an estimated change in the median of y by a factor of 0.74 for every 1-unit increase in x ... or better yet, a 26% decrease.
Log-linear means an exponential: ln(y) = a x + b is equivalent to y = exp(a x) * exp(b), which is of the form A^x * B. Likewise, a log-log transform gives a power law: ln(y) = a ln(x) + b is of the form y = B * x^a, with B = exp(b).
On a log-linear plot an exponential will thus be a straight line, and a power law will be on a log-log plot.

How to determine distance to a point on arc perpendicular from tangent?

Given the following from the image below:
The green circle has a radius equal to B
The yellow line is tangent to the green circle
The vertical purple line is parallel to the green line and perpendicular to the yellow line.
The yellow line is perpendicular to both the green line and the vertical purple line
The purple point is centered on the green circle's edge
A and B are known values
I realize several of these constraints overlap, just trying to be thorough.
Pythagorean's theorem can provide the value of C, just to illustrate what I know we can determine already.
What is the formula/equation to determine D, where D is the perpendicular distance from the tangent yellow line to the arc/circle (at the purple point)?
Update
Replacing previous attempts to illustrate solution now with one that I can now visualize as the correct representation of the answer and comments provided by John
The distance D can be found by computing the lowest intersection between the vertical ray from the right endpoint of the yellow segment and the circle.
Some notations (x axis to the right, y axis to the bottom, origin at the center of the circle):
center of the circle: P_C = (0, 0)
origin of the vertical ray: P_O = (A, B)
direction of the vertical ray: v_d = (0, -1)
Points on the ray satisfy: P = P_O + t v_d = (A, B - t)
Points on the circle satisfy: |P P_O|^2 = B^2
Expanding the first equation into the second gives: A^2 + (B - t)^2 = B^2 = A^2 + B^2 - 2 B t + t^2
Solving t^2 - 2 B t + A^2 = 0 for t yields d = B^2 - A^2 > 0, so two solutions t_1 = B - sqrt(d), t_2 = B + sqrt(d) (one near the bottom of the circle, the other near the top as expected). But t actually gives the distance along the ray (since v_d is a unit vector), so what we are looking for is the smallest solution t_1. Hence D = B - sqrt(B^2 - A^2).
The final result can also be derived and / or verified geometrically (courtesy of John, see all the corresponding comments): D = B - B' and B'^2 + A^2 = B^2 (Pythagorus on the right triangle with the center of the circle and the purple point as two of its vertices and an edge sitting on the purple line).
As you mentioned C is the easy part. However with A,B,C and the cosine theorem you can work out the angel opposite to B (b):
cos(b) = (a^2 + c^2 -b^2)/(2ac)
knowing b and that A and D have a right angel you can work out the angle between C and D (b'):
b' = 90° - b
given that D lies on the circle you know that the distance from the center to D is B so you now have a triangle with sides B,D and C where you know two of the sides and one of the angles. With the cosine law again:
B^2 = C^2 + D^2 - 2CD cos(b')
so in one more step we can find:
B^2 - C^2 = D^2 - 2CD cos(b') + (C cos(b'))^2 -(C cos(b'))^2 <=>
B^2 - C^2 + (C cos(b'))^2 = (D - C cos(b'))^2 <=>
sqrt(B^2 - C^2 + (C cos(b'))^2) + C cos(b') = D
hope I didn't put stupid mistakes in there and this helps...

estimate angle between two lines y = 1000x and y = 999x

How to estimate the angle between line y = 1000 x and y = 999 x?
I use the calculator and get 10^(-6) but how to approximate it by hand. Does it relate to Taylor Expansion?
The slope of the first line is 1000 and that of the second is 999. Simply use the formula
\theta = \arctan\frac{m_1-m_2}{1+m_1m_2},
where m_1 is the slope of 1000 and m_2 is the slope of 999.
You should get an answer of 1.00099×10^{-6} radians.
To use a Taylor-McLaurin series, you should go by https://math.stackexchange.com/questions/348711/maclaurin-series-for-arctanx-by-successive-differentiation, and substitute the value of \frac{m_1-m_2}{1+m_1m_2} for x in each of the successive terms.

Square divided by a ray. What is the area of a part?

I have a square, for simplicity assume bottom left corner is on origin and width of the square is 1.
A ray divides the square into two parts. I have the coordinates of intersection points. I want to obtain the area that lies right of the vector from p1 to p2:
Right now I have 16 if statements checking every combination of 2 points and calculating the area accordingly. It looks awful. Is there a more clever way of doing this?
Call the points A and B instead of p1 and p2. I'll assume x increases to the right and y increases upward, as per convention.
The point A must have a coordinate (x or y) that is 0 or 1. Rotate the square (really just the two points) to make it x=0.
The point B might be at x=-1, in which case the area is 1-(Ay+By)/2.
Or B might be at y=0, area = 1+(AyBx)/2
Or B might be at y=1, area = (Ay-1)Bx/2
This solution assumes that p1 and p2 form a right-triangle as depicted in the shaded area:
Area to the right of the vector = (w * w) - (0.5 * p1 * p2)
where w is the width of the square, and 0 <= p1 <= w, and 0 <= p2 <= w.
For example if w = 1, p1 = 0.5, and p2 = 0.75
then Area = (1 * 1) - (0.5 * 0.5 * 0.75) = 0.8125

Resources