POV-Ray : Newsgroups : povray.programming : numpy linalg.norm question Server Time
4 Oct 2024 05:33:54 EDT (-0400)
  numpy linalg.norm question (Message 1 to 2 of 2)  
From: Bald Eagle
Subject: numpy linalg.norm question
Date: 28 Oct 2019 21:50:00
Message: <web.5db79a50ca919d2f4eec112d0@news.povray.org>
I'm working on converting a python script into SDL, and I have most of the
matrix operations worked out, and just need to do a few more things before I can
start debugging (because you KNOW it never works the first time.)

I wrote a Norm (_Array) macro to take each element of a 2D array, square it, and
sum all the squares, then take the square root of that sum.

I now have this in front of me:
#local err = np.linalg.norm(new_u - U);

Do I make a new array that has each element equaling _A[i][j]-_B[i][j] and then
take the norm of that?

Just checking with anyone running python and familiar enough to give a quick
confirmation one way or the other.


Post a reply to this message

From: Bald Eagle
Subject: Re: numpy linalg.norm question
Date: 28 Oct 2019 22:10:00
Message: <web.5db79f027e60be924eec112d0@news.povray.org>
Ugh.
I also have this beauty to unravel:

np.array([[a * b for b in center] for a in center])

center is a 2D array / matrix


Here I'm truly lost.
I'll have to read that over 100 times and never know if I'm interpreting it the
right way.   :O


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.