Line coordinates [closed] - math

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
how can we calculate the coordinates of a line (Formula used) when the length and angle is given.
I have to make a pop up box which will take as input the length and angle and will draw a line.
just need the formula

Assuming one end of the line is at (x0, y0), the other end will be at:
x1 = x0 + r cos(t * pi / 180)
y1 = y0 + r sin(t * pi / 180)
where r is the length of the line and t is the angle in degrees.

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))

Basic Math Equation [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 5 years ago.
Improve this question
y=0 and x=0
Both increment by 1 every millisecond, but x=0 whenever it reaches 120.
What is the equation for finding x if y is... 5000?
x = y % 120
% is called modulus
You just use modulus.
(y / 120) + (y % 120) = x

Getting theta of Line Equation [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 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)

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

find point on a line segment to form right triangle? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Given a line segment from A (10, 100) to B (300, 300);
and then point A' (10, 200) where A' has the same x, but a different y, as A, how do I find the point where a line from A' would intersect the line AB at D so that A, A', and D form a right triangle?
Get the equation for the line and substitute in the y you already have.

Resources