Getting theta of Line Equation [closed] - math

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
Please forgive my lack of knowledge, which i think it's one of those basic formula related to Trigonometry.
Let's look at visual example:
I have 5 lines, with their line equation (let's say they have zero offset ok)
how can i calculate the Theta of each line equation make (in Pi)?
also I have seen this:
Are they generated from Theta of line equations? or it's another theory which help to find the theta?
much appreciate your time and effort

For equation
y = k * x
tg(Theta) = k
and
Theta = Arctg(k) //arctangent function
General line equation
A * x + B * y + C = 0
(It is more general than y=ax+b and includes cases of vertical and horizontal lines)
Theta = atan2(A, B)
(function atan2 or ArcTan2 exists in math libraries of many programming languages)

Related

Hist of circular residual in R programme between -pi and pi [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have the data of error, firstly I need to transform the range of data between -pi and pi
then using code hist(error)
my question is how I can transform this data using code in R, if there exists code please tell me?
error<- c( 5.71444784 ,5.55435896 ,5.60671884, 5.19927462 ,4.81470000 ,5.53028500,
0.87085808 ,5.37982604, 5.43760222 ,5.77523327, 5.68796681 ,5.54533123,
5.27149485 ,5.75717780 ,0.53623627 ,5.29496664 ,5.33288247 ,5.49297135,
5.51343389 ,4.87307837 ,4.87849468 ,5.78305665, 0.13721761 ,5.91185037,
5.50741540 ,5.72588264, 5.03918574, 4.14846564 ,5.25644862 ,0.57956841,
0.37614739, 0.40864692, 5.92087811, 5.92689660, 5.72889189 ,5.64643955,
5.96902437, 5.91666449, 6.18508456 ,5.86249974 ,5.17279359, 5.37982604,
5.25163450, 5.43098155, 5.73912232, 5.80592625 ,5.43940710, 4.84659734,
5.76078923, 5.76379847, 5.76078923 ,5.78606589, 5.68977169 ,5.68375320,
0.42790509 ,6.08939254, 4.89955940 ,5.53389643, 5.67954126 ,5.71324348,
5.66930915 ,5.54111761 ,5.87273017, 5.86791605 ,5.50199909, 5.50199909,
5.69699455 ,5.29737370 ,4.97117745, 5.62838408 ,5.77402891, 5.30640144,
5.85106494 ,5.58926555 ,5.58926555 ,4.62271379 ,3.36547454, 6.19892642,
0.28888093 ,6.09541103, 5.89499926 ,5.87453672, 5.67954126 ,5.46408326,
1.44982681 ,0.24193736 ,0.77516606 ,5.88055521, 5.55435896, 5.58926555,
5.58926555 ,5.39126084, 4.47466189, 0.06800662, 5.75777998, 5.44963921)
I try this problem by transforming the data handly .... and hist ... but the residual doesn't about zero.
To compute the range from -pi to pi just subtract pi from the radian measurement since radians range from 0 to 2*pi:
error - pi
hist(error - pi)
But that does not give you what you want. You really need to use circular statistics to see what is going on:
install.packages("circular")
library(circular)
plot.circular(error, stack=TRUE)
You can ignore the warning message. Notice that the data are not around zero. To plot a histogram we need to cut the data at pi and flip the values greater than pi:
errortrans <- ifelse(error<pi, error, error-2*pi)
# Alternate transform
# errortrans <- ifelse(error<pi, -error, 2*pi-error)
hist(errortrans, xlim=c(-pi, pi))

Find x and y coordinates where a perpendicular point crosses a straight line [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 3 years ago.
Improve this question
This is a follow-up question to this question.
Taking the following image as an example:
What I know:
x and y coordinates of points D, E, and P.
Therefore, I also know slope and intercept of D-E line
What I want to know:
x and y coordinates of point Q. (This is the point which crosses the D-E line).
Notation P=[px,py], D=[dx,dy], E=[ex,ey], Q=[qx,qy]
First:
R=P-D=[px-dx, py-dy]=[rx,ry]
K=E-D=[ex-dx, ey-dy]=[kx, ky]
Then
z=dot(R,K)/dot(K,K)=(rx*kx+ry*ky) / (kx*kx+ky*ky)
Finally
Q=D+z*K=[dx+z*kx, dy+z*ky]
The R is vector which start on point D and ends on point K, the K is vector which start on point D and ends on point E. Using this we made scalar projection to calculate result Q. More info about concept here

Logical Venn Diagrams [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I have this question :
Unfortunately, my book didn't provide definition and how to draw/read a logic venn diagram, i have to look at the internet but couldn't find any understandable explanation
From what i understand, the logics for the three diagrams are :
X AND NOT (Y OR Z)
NOT X AND (Y OR Z)
Y AND NOT (X OR Z)
Am i right ? Please correct me if i'm wrong
By the ways, does the question mean to combine all three diagrams with OR operation, like :
1 OR 2 OR 3
Any help is greatly appreciated !
I could not understand the question correctly. Here's the logic for the three Venn Diagrams:
1. Your logic for the first Venn Diagram is correct: X AND NOT (Y OR Z)
2. Your logic for the second Venn Diagram is slightly incorrect, if you look at the Venn Diagram: It is simply NOT (X) (Everything except X).
3. In this case as well, the logic is simply Y.
Now if we perform OR operation on these three:
(X AND NOT (Y OR Z)) + NOT(X) + Y
= X AND NOT(Y) AND NOT(Z) OR NOT(X) OR Y [By de Morgan's law]
which matches option c.
NOTE: Your second and third logics would have been correct if X, Y and Z were the only three regions in the diagram. However there is also a region outside all of them - bounded by the box. You might want to look up on the internet about basics of Venn Diagram, it's one of the easiest things to learn IMO!

Find new coordinate (x', y') given (x, y) , theta, and velocity? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 months ago.
Improve this question
Given (x,y) that is (3,4) , velocity is 1 m/sec and given angle is 15 degree. what will be next coordinate (x', y') after 1 sec ?
Anyone please help!
Assuming the angle is measure w.r.t. the x-axis, then:
the total distance is v*t = 1m
displacement in x-direction: cos(15)*1m=.97m
displacement in y-direction: sin(15)*1m=.25m
So the new location is (3.97, 4.25).
#Alexander-Vogt's answer is close but I think it is missing a conversion from angles to radians. Here is matlab code that provides the answer:
pi=3.1415926535897932384626433832795028841971;
x=3;y=4;
t=1; % time
s=1*t; % speed * time
a=15; % angle of movement
a=a/360 * pi*2; % convert to radians
x=cos(a)*s+x;
y=sin(a)*s+y;
fprintf("%f %f\n",x,y);

Given a cartesian equation of a plane , how can find the equation of a rotated plane [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to rotate a plane represented by the equation z = 6 , by n degrees along y axis and find the new equation of the plane. how can this be done?
Thanks
Base point (0,0,6) after rotation will lie in XZ plane with coordinates
(x0, y0, z0) = (-6*sin(Fi), 0, 6*cos(Fi))
normal vector
n = (A,B,C) = (-sin(Fi), 0, cos(Fi))
so new plane equation is (for explanation see beginning of the article)
A*(x-x0)+B*(y-y0)+C*(z-z0)=0
or
-sin(Fi)*x + cos(Fi)*z - 6 = 0

Resources