An interesting Vector Math Problem

Let's talk about algorithms!

Moderator: Board moderators

Post Reply
Shahriar Nirjon
New poster
Posts: 16
Joined: Tue Dec 03, 2002 9:44 pm

An interesting Vector Math Problem

Post by Shahriar Nirjon »

You are given n vectors in 3D: a1, a2 ... an. The task is to find a unit vector d, for which the value of following expression is maximum:
|a1 x d| + |a2 x d| + ... + |an x d|.

Here,
1. all the vectors are in 3 dimension.
2. d is a unit vector.
3. a1 x d means the cross product of a1 and d.
4. |a1 x d| means the magtitute of a1 x d.

/* In an alternate way, you can think of the problem as- finding a line in 3D for which the sum of distances from n points is maximum */
mf
Guru
Posts: 1244
Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland
Contact:

Re: An interesting Vector Math Problem

Post by mf »

How large can n be?
Shahriar Nirjon
New poster
Posts: 16
Joined: Tue Dec 03, 2002 9:44 pm

Re: An interesting Vector Math Problem

Post by Shahriar Nirjon »

n canbe very large. For now, you can asume n <= 1000. Note that, for the same problem in 2D, I can think of a solution in O(n). Just take the vector summation of b1, b2 .. bn where bi is the perpendicular normal vector to ai having the same length as ai.
Post Reply

Return to “Algorithms”