PASTEDOWN   149   0
   60 416 B    15

Polar decomposition

By Synthbot
Created: 2022-02-17 00:25:50
Expiry: Never

import numpy
import math

def polar_decomposition(matrix):
    u, s, vh = numpy.linalg.svd(matrix)
    pu = u @ vh # rotation matrix
    angle = math.atan2(pu[1,0], pu[0,0])
    pp = vh.T @ numpy.diag(s) @ vh # scaling matrix
    return pp, angle

def recompose_polar(pp, angle):
    pu = numpy.array([[math.cos(angle), -math.sin(angle)], [math.sin(angle), math.cos(angle)]])
    return pu @ pp

Pony Preservation Project - /mlp/con 2021

by Synthbot

Pony Preservation Project - /mlp/con 2020

by Synthbot

Preservation Project History - 2020 to 2021

by Synthbot

Missing music

by Synthbot

Animation format

by Synthbot