Boost logo

Boost :

From: Michael Fawcett (michael.fawcett_at_[hidden])
Date: 2006-06-12 11:33:34

On 6/9/06, Andy Little <andy_at_[hidden]> wrote:
> In cases of vectors, I have only used vectors where all elements are one type of
> quantity. The vectors are used to represent position, direction and so on in 3
> dimensions. A container that holds different quantities I would consider to be a
> tuple. But I stress I am not an expert.

I am not an expert either, but in practice I have used (incorrectly?
should I have used a tuple or a custom data type?) vectors for
representing latitude/longitude/altitude with mixed units. Something
like vec3<double, unsigned short, double> for decimal degrees, meters,
decimal degrees. I often need to move back and forth from those units
to nautical miles and feet, and I bet a library like PQS would help me
out more than meaningful variable names.

I am ambivalent about whether the vector should allow mixed data types
or not. I could settle for using a tuple instead, as long as vector
functions like normalize(my_vec3) or length(my_vec) worked on tuple
types as well.

--Michael Fawcett

Boost list run by bdawes at, gregod at, cpdaniel at, john at