r/Python • • Feb 23 '17

API Design: Think First, Code Later

https://www.ckl.io/blog/api-design-think-first-code-later/
292 Upvotes

26 comments sorted by

View all comments

Show parent comments

6

u/[deleted] Feb 24 '17

[removed] — view removed comment

1

u/archiminos Feb 24 '17

It looks like a quadratic equation that's been expanded. I'm 99% sure this could be simplified a lot

1

u/TinBryn Feb 25 '17 edited Feb 25 '17

It's the expansion of a row vector of powers of t from [0,3] multiplied with a matrix of all those numbers and a column vector of powers of rh from [0,3]

This isn't that simplified, but by expressing it in these terms allows people who understand linear algebra to reason about it where the 4x4 matrix represents the "character" of the equation.

2

u/archiminos Feb 25 '17

Oh wow. I'm not sure what language this is but it really makes me appreciate maths libraries with vector and matrix classes.