Opposite coordinate in the image
Show older comments
Hi!!!
I would like to find the opposite coordinate in the image according to the slope angle of a known vector. How can I achieve this?

9 Comments
DGM
on 24 Jul 2022
What exactly are the known pieces of information, and in what form are they given?
Ariane Moura
on 24 Jul 2022
Ariane Moura
on 24 Jul 2022
Ariane Moura
on 24 Jul 2022
Ariane Moura
on 24 Jul 2022
DGM
on 24 Jul 2022
"file also has the unknown coordinates represented by ? in the drawing." ???
How would these be the unknown coordinates? They aren't on the edge of the image, nor are they unknown.
Is it safe to assume the coordinates are in pixels?
Which intersection are you trying to find? Since if these are in pixels, none of the points lie on the edge of the image. Each line can have two intersections, so which ones? All of them? Only intersections with the bottom edge? What if a line doesn't intersect the bottom edge?
Ariane Moura
on 24 Jul 2022
Ariane Moura
on 24 Jul 2022
Ariane Moura
on 24 Jul 2022
Answers (1)
Use linexlines2D, to be downloaded from,
load Vertices
Nv=size(Vg,1);
[ymax,xmax]=size(Image);
Vg(:,3)=1;
V=repmat(v,Nv,1);
E=cross(Vg,V).'; %line equations
points=linexlines2D(E, [0,ymax] , [xmax,ymax]); %the result
4 Comments
Ariane Moura
on 24 Jul 2022
Here's a more concrete example to demonstrate that it works:
Vg=[0:3;zeros(1,4)]'
v=[3,7,0];
Nv=size(Vg,1);
[ymax,xmax]=deal(7);
Vgh=Vg; Vgh(:,3)=1;
V=repmat(v,Nv,1);
E=cross(Vgh,V).'; %line equations
result=[Vg, linexlines2D(E, [0,ymax] , [xmax,ymax])'] %the result
Ariane Moura
on 25 Jul 2022
Categories
Find more on L*a*b* Color Space in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
