[GiNaC-devel] Find length of a vector

Jan Rheinländer jrheinlaender at gmx.de
Sat Nov 2 12:11:06 CET 2024


Hi,

trying to find the length of a vector by taking the square root of the 
scalar product, I get this (in ginsh):

> v = [[a,b]];
[[a,b]]
 > r = sqrt(v * transpose(v));
sqrt([[a,b]]*[[a],[b]])
 > evalm(r);
matrix::pow(): don't know how to handle exponent

The reason is that the scalar product evaluates to a matrix with a 
single element, not to a numeric. Is that intended?

Thanks,

Jan Rheinländer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ginac.de/pipermail/ginac-devel/attachments/20241102/14d432c8/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 321 bytes
Desc: OpenPGP digital signature
URL: <http://www.ginac.de/pipermail/ginac-devel/attachments/20241102/14d432c8/attachment.sig>


More information about the GiNaC-devel mailing list