Some problems with taking magnitudes: if I have a mathvector of complex numbers, then the magnitude should return a real, not complex, number. Also, it shouldn't be defined as x*x, as this is wrong for complex numbers. Need to call a magnitude function for the type. Maybe also need a magnitude type. Define with traits?