# Math library using Swift Numerics

**URL:** <https://forums.swift.org/t/math-library-using-swift-numerics/42849>\
**Category:** Community Showcase\
**Tags:** generics, math, simd\
**Created:** [December 15, 2020, 8:10pm UTC](https://forums.swift.org/t/math-library-using-swift-numerics/42849 "2020-12-15T20:10:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfbigelow](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/rfbigelow/32/4773_2.png) [@rfbigelow](https://forums.swift.org/u/rfbigelow)\
**Post date:** [December 15, 2020, 8:10pm UTC](https://forums.swift.org/t/math-library-using-swift-numerics/42849/1 "2020-12-15T20:10:35Z")

</div>

I'm working through Foundations of Game Engine Development vol. 1: Mathematics by Eric Lengyel and decided to try my hand at writing a Swift package based on the material therein. I've been following the exploits of @scanon, first with SIMD types, then Swift Numerics, and wanted to play with these new toys.

You can find the library at [FGED.Mathematics](https://github.com/rfbigelow/FGED.Mathematics).

This is my first attempt at writing such a library, and my first try at protocol-oriented programming. I'd love to hear any feedback from the Swift community about the code, especially WRT protocol-oriented programming and generics. Eric uses some classes to relate vectors and positions, for example, and I wanted to capture that somehow in Swift while modeling everything with value types. Things got a bit tricky when I established the relationships between points, vectors, and matrices, and I'm not sure if I went about things in the right way.
