Save below code except OUTPUT as line_int.m
function [P]=line_int(P1,P2,P3,P4)
PA=[P1(1) P2(1) P3(1) P4(1)];
PB=[P1(2) P2(2) P3(2) P4(2)];
[m,b]=line_eq(PA,PB);
P=inv([-m(1) 1;-m(2) 1])*b;
function [m,b]=line_eq(PA,PB)
m1=(PB(2)-PB(1))/(PA(2)-PA(1));
b1=(PB(1)-m1*PA(1));
m2=(PB(4)-PB(3))/(PA(4)-PA(3));
b2=(PB(3)-m2*PA(3));
m=[m1 m2];
b=[b1;b2];
end
end
OUTPUT----------------------------------------------------------------------------------------------
>> line_int([-1 0], [3 6], [-2 6], [7 -3]) ans = 1.0000 3.0000
Using MATLAB Please Write a MATLAB function that takes coord natos of four points as inputs and returns the coord nates of ntersection of the line passing through ooints 1 and 2 and the line passing t...
Let L1 be the line passing through the points Q1(−2, −5, −3) and Q2(2, −3, −1) and let L2 be the line passing through the point P1(11, 1, 4) with direction vector d=[3, 1, 2]T. Determine whether L1 and L2 intersect. If so, find the point of intersection Q.
Let L1 be the line passing through the points Q1=(-5, 1,-4) and Q2=(1,-8,-1) and let L2 be the line passing through the point P1=(-10, 16,-5) with direction vector d=[-1,-1,-1]T. Determine whether L1 and L2 intersect. If so, find the point of intersection Q
Question 7 (10 points] Let Ly be the line passing through the points Q1-(3,-1,-4) and Q2=(5,-3,-2) and let La be the line passing through the point P4-(12,-4, 3) with direction vector a-(-6, -6, -21". Determine whether Ly and L2 intersect. If so, find the point of intersection Q. The lines intersect at the following point Q: Q=(0,0,0)
--> Econ Graph Review a) The equation of the line passing through the points (5, 1) and (8, 2) is ay = x + b. Find the values for constants a and b. Represent this function in a xy plane. b) Let L be the line passing through the point (4, 9) with slope 3/4. Represent this function using the y = mx + b formula. Find the y-intercept of L. c) Graph the following two equations on the same...
please solve in matlab 1[35p) Write a user-defined MATLAB function that determines the unit vector in the direction of the line that connects two points (A and B) in space. For the func- tion name and arguments, use n = unitvec (A,B). The input to the function are two vectors A and B, each with the Cartesian coordinates of the corre- sponding point. The output is a vector with the components of the unit vector Join the direction from A...