Prev: AVI write and/or read problem
Next: ocean mask
From: Adam Hall on 31 Mar 2010 18:25 This comes from Introduction to Scientific Computing by Charles Van Loan... I forget the edition, but the question is this: % Implement the following function % function [u,v] = Lines(a,b,c,d) % % a,b,c and d are column n-vectors with the property that for i=1:n, the % lines % % x(t1) = a(i) + t1(b(i) - a(i)) -inf < t1 < inf % y(t2) = c(i) + t2(d(i) - c(i)) -inf < t2 < inf % % intersect. The points of intersection (u(i),v(i)) are returned in column % n-vectors u and v. % % Your implementation should use Gaussian Elimination with partial pivoting % to solve for the intersection points. It should be fully vectorized. (No loops necessary.) I'm completely lost as to how to solve this. I know how to do it by hand, but writing a function that does it is proving a little more difficult. Can anyone lead me in the right direction?
|
Pages: 1 Prev: AVI write and/or read problem Next: ocean mask |