1
0
mirror of https://github.com/slendidev/smath.git synced 2026-03-17 02:26:50 +02:00

Compare commits

...

6 Commits

Author SHA1 Message Date
e063b10af5 docs: Ignore macros the user should not be aware of
Signed-off-by: Slendi <slendi@socopon.com>
2026-03-12 09:16:30 +02:00
cf490494c3 Fix .gitignore and add build_docs.sh
Signed-off-by: Slendi <slendi@socopon.com>
2026-03-12 08:35:40 +02:00
2719e1d746 ci: update docs workflow to use new build script
Signed-off-by: Slendi <slendi@socopon.com>
2026-03-12 08:33:03 +02:00
d113c492c9 Try another approach on removing the header
Signed-off-by: Slendi <slendi@socopon.com>
2026-03-12 08:31:55 +02:00
24c3769e22 Add logo to Doxygen documentation
Signed-off-by: Slendi <slendi@socopon.com>
2026-03-12 08:27:02 +02:00
6471d48d35 Fix some unused variable warnings
Signed-off-by: Slendi <slendi@socopon.com>
2026-03-12 03:09:02 +02:00
16 changed files with 1273 additions and 7 deletions

View File

@@ -21,13 +21,13 @@ jobs:
- uses: actions/checkout@v4
- name: Install Doxygen
run: sudo apt-get update && sudo apt-get install -y doxygen graphviz
run: sudo apt-get update && sudo apt-get install -y doxygen graphviz perl
- name: Create output directory
run: mkdir -p build/docs
- name: Generate docs
run: doxygen docs/Doxyfile
run: ./docs/build_docs.sh
- name: Disable Jekyll
run: touch build/docs/html/.nojekyll

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
[Bb]uild*
![Bb]uild*.*
.cache
result
.direnv

View File

@@ -1,7 +1,7 @@
<p align="center">
<img alt="smath logo" width="100%" src="https://github.com/user-attachments/assets/d6f2ef4b-eca0-4004-9099-37423528bcba" />
<br><br>
<a href="https://github.com/slendidev/smath/actions/workflows/build.yml">
<img alt="smath logo" width="100%" src="https://paste.slendi.dev/LcCPsJ.svg" />
<br><br>
<a href="https://github.com/slendidev/smath/actions/workflows/build.yml">
<img src="https://github.com/slendidev/smath/actions/workflows/build.yml/badge.svg" alt="Build">
</a>
<a href="LICENSE.txt">

View File

@@ -20,7 +20,10 @@ GENERATE_TREEVIEW = YES
DISABLE_INDEX = NO
FULL_SIDEBAR = NO
HTML_COLORSTYLE = LIGHT
HTML_EXTRA_STYLESHEET = docs/vendor/doxygen-awesome.css
PROJECT_LOGO = docs/smath_light.svg
HTML_EXTRA_STYLESHEET = docs/vendor/doxygen-awesome.css docs/custom.css
HTML_EXTRA_FILES = docs/smath_dark.svg docs/smath_big.svg
LAYOUT_FILE = docs/DoxygenLayout.xml
WARN_IF_UNDOCUMENTED = YES
QUIET = NO

270
docs/DoxygenLayout.xml Normal file
View File

@@ -0,0 +1,270 @@
<?xml version="1.0" encoding="UTF-8"?>
<doxygenlayout version="2.0">
<!-- Generated by doxygen 1.14.0 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="topics" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="" intro="">
<tab type="modulelist" visible="yes" title="" intro=""/>
<tab type="modulemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="concepts" visible="yes" title="">
</tab>
<tab type="interfaces" visible="yes" title="">
<tab type="interfacelist" visible="yes" title="" intro=""/>
<tab type="interfaceindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="interfacehierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="structs" visible="yes" title="">
<tab type="structlist" visible="yes" title="" intro=""/>
<tab type="structindex" visible="$ALPHABETICAL_INDEX" title=""/>
</tab>
<tab type="exceptions" visible="yes" title="">
<tab type="exceptionlist" visible="yes" title="" intro=""/>
<tab type="exceptionindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="exceptionhierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="user" url="https://github.com/slendidev/smath" title="GitHub"/>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_HEADERFILE"/>
<inheritancegraph visible="yes"/>
<collaborationgraph visible="yes"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes visible="yes" title=""/>
<services visible="yes" title=""/>
<interfaces visible="yes" title=""/>
<publicslots visible="yes" title=""/>
<signals visible="yes" title=""/>
<publicmethods visible="yes" title=""/>
<publicstaticmethods visible="yes" title=""/>
<publicattributes visible="yes" title=""/>
<publicstaticattributes visible="yes" title=""/>
<protectedtypes visible="yes" title=""/>
<protectedslots visible="yes" title=""/>
<protectedmethods visible="yes" title=""/>
<protectedstaticmethods visible="yes" title=""/>
<protectedattributes visible="yes" title=""/>
<protectedstaticattributes visible="yes" title=""/>
<packagetypes visible="yes" title=""/>
<packagemethods visible="yes" title=""/>
<packagestaticmethods visible="yes" title=""/>
<packageattributes visible="yes" title=""/>
<packagestaticattributes visible="yes" title=""/>
<properties visible="yes" title=""/>
<events visible="yes" title=""/>
<privatetypes visible="yes" title=""/>
<privateslots visible="yes" title=""/>
<privatemethods visible="yes" title=""/>
<privatestaticmethods visible="yes" title=""/>
<privateattributes visible="yes" title=""/>
<privatestaticattributes visible="yes" title=""/>
<friends visible="yes" title=""/>
<related visible="yes" title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription visible="yes" title=""/>
<memberdef>
<inlineclasses visible="yes" title=""/>
<typedefs visible="yes" title=""/>
<enums visible="yes" title=""/>
<services visible="yes" title=""/>
<interfaces visible="yes" title=""/>
<constructors visible="yes" title=""/>
<functions visible="yes" title=""/>
<related visible="yes" title=""/>
<variables visible="yes" title=""/>
<properties visible="yes" title=""/>
<events visible="yes" title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<concepts visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<typedefs visible="yes" title=""/>
<sequences visible="yes" title=""/>
<dictionaries visible="yes" title=""/>
<enums visible="yes" title=""/>
<functions visible="yes" title=""/>
<variables visible="yes" title=""/>
<properties visible="yes" title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription visible="yes" title=""/>
<memberdef>
<inlineclasses visible="yes" title=""/>
<typedefs visible="yes" title=""/>
<sequences visible="yes" title=""/>
<dictionaries visible="yes" title=""/>
<enums visible="yes" title=""/>
<functions visible="yes" title=""/>
<variables visible="yes" title=""/>
<properties visible="yes" title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a concept page -->
<concept>
<briefdescription visible="yes"/>
<includes visible="$SHOW_HEADERFILE"/>
<definition visible="yes" title=""/>
<detaileddescription visible="yes" title=""/>
<authorsection visible="yes"/>
</concept>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="yes"/>
<includedbygraph visible="yes"/>
<sourcelink visible="yes"/>
<memberdecl>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<concepts visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines visible="yes" title=""/>
<typedefs visible="yes" title=""/>
<sequences visible="yes" title=""/>
<dictionaries visible="yes" title=""/>
<enums visible="yes" title=""/>
<functions visible="yes" title=""/>
<variables visible="yes" title=""/>
<properties visible="yes" title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription visible="yes" title=""/>
<memberdef>
<inlineclasses visible="yes" title=""/>
<defines visible="yes" title=""/>
<typedefs visible="yes" title=""/>
<sequences visible="yes" title=""/>
<dictionaries visible="yes" title=""/>
<enums visible="yes" title=""/>
<functions visible="yes" title=""/>
<variables visible="yes" title=""/>
<properties visible="yes" title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="yes"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<modules visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<concepts visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines visible="yes" title=""/>
<typedefs visible="yes" title=""/>
<sequences visible="yes" title=""/>
<dictionaries visible="yes" title=""/>
<enums visible="yes" title=""/>
<enumvalues visible="yes" title=""/>
<functions visible="yes" title=""/>
<variables visible="yes" title=""/>
<signals visible="yes" title=""/>
<publicslots visible="yes" title=""/>
<protectedslots visible="yes" title=""/>
<privateslots visible="yes" title=""/>
<events visible="yes" title=""/>
<properties visible="yes" title=""/>
<friends visible="yes" title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription visible="yes" title=""/>
<memberdef>
<pagedocs/>
<inlineclasses visible="yes" title=""/>
<defines visible="yes" title=""/>
<typedefs visible="yes" title=""/>
<sequences visible="yes" title=""/>
<dictionaries visible="yes" title=""/>
<enums visible="yes" title=""/>
<enumvalues visible="yes" title=""/>
<functions visible="yes" title=""/>
<variables visible="yes" title=""/>
<signals visible="yes" title=""/>
<publicslots visible="yes" title=""/>
<protectedslots visible="yes" title=""/>
<privateslots visible="yes" title=""/>
<events visible="yes" title=""/>
<properties visible="yes" title=""/>
<friends visible="yes" title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a C++20 module page -->
<module>
<briefdescription visible="yes"/>
<exportedmodules visible="yes"/>
<memberdecl>
<concepts visible="yes" title=""/>
<classes visible="yes" title=""/>
<enums visible="yes" title=""/>
<typedefs visible="yes" title=""/>
<functions visible="yes" title=""/>
<variables visible="yes" title=""/>
<membergroups visible="yes" title=""/>
</memberdecl>
<detaileddescription visible="yes" title=""/>
<memberdecl>
<files visible="yes"/>
</memberdecl>
</module>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription visible="yes" title=""/>
</directory>
</doxygenlayout>

10
docs/build_docs.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
doxygen "${repo_root}/docs/Doxyfile"
"${repo_root}/docs/postprocess-doxygen.sh" "${repo_root}/build/docs/html"
echo "Docs generated at ${repo_root}/build/docs/html"

17
docs/custom.css Normal file
View File

@@ -0,0 +1,17 @@
#titlearea {
padding-right: 0;
}
#projectlogo img {
height: 40px;
width: auto;
}
#projectname,
#projectbrief {
display: none;
}
html.dark-mode #projectlogo img {
content: url('smath_dark.svg');
}

13
docs/postprocess-doxygen.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
html_dir="${1:-build/docs/html}"
index_file="${html_dir%/}/index.html"
if [[ ! -f "${index_file}" ]]; then
echo "error: ${index_file} not found" >&2
exit 1
fi
perl -0pi -e 's{<div><div class="header">\s*<div class="headertitle"><div class="title">.*?</div></div>\s*</div><!--header-->\s*}{}s' "${index_file}"

190
docs/smath_big.svg Normal file
View File

@@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="1280"
height="640"
viewBox="0 0 1280.0001 640.00006"
version="1.1"
id="svg1"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1">
<linearGradient
id="linearGradient13">
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="0"
id="stop12" />
<stop
style="stop-color:#16d800;stop-opacity:1;"
offset="1"
id="stop13" />
</linearGradient>
<linearGradient
id="linearGradient10">
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="0"
id="stop10" />
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="1"
id="stop11" />
</linearGradient>
<linearGradient
id="linearGradient8">
<stop
style="stop-color:#c50000;stop-opacity:1;"
offset="0"
id="stop8" />
<stop
style="stop-color:#ff0c0c;stop-opacity:1;"
offset="1"
id="stop9" />
</linearGradient>
<linearGradient
id="linearGradient5">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop5" />
<stop
style="stop-color:#969696;stop-opacity:1;"
offset="1"
id="stop6" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient5"
id="linearGradient6-2"
x1="482.5849"
y1="589.83472"
x2="613.15253"
y2="-24.437733"
gradientUnits="userSpaceOnUse" />
<rect
x="227.90907"
y="175.81558"
width="659.85107"
height="227.90907"
id="rect1-5" />
<linearGradient
xlink:href="#linearGradient10"
id="linearGradient11-0"
x1="50.894115"
y1="80.727814"
x2="50.894115"
y2="68.866821"
gradientUnits="userSpaceOnUse" />
<marker
style="overflow:visible"
id="RoundedArrow-45"
refX="0"
refY="0"
orient="auto-start-reverse"
markerWidth="1"
markerHeight="1"
viewBox="0 0 1 1"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.7)"
d="m -0.21114562,-4.1055728 6.42229122,3.21114561 a 1,1 90 0 1 0,1.78885438 L -0.21114562,4.1055728 A 1.236068,1.236068 31.717474 0 1 -2,3 v -6 a 1.236068,1.236068 148.28253 0 1 1.78885438,-1.1055728 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:none"
id="path8-2" />
</marker>
<linearGradient
xlink:href="#linearGradient8"
id="linearGradient9-6"
x1="107.55984"
y1="103.63171"
x2="51.891579"
y2="103.63171"
gradientUnits="userSpaceOnUse" />
<marker
style="overflow:visible"
id="RoundedArrow-4-1"
refX="0"
refY="0"
orient="auto-start-reverse"
markerWidth="1"
markerHeight="1"
viewBox="0 0 1 1"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.7)"
d="m -0.21114562,-4.1055728 6.42229122,3.21114561 a 1,1 90 0 1 0,1.78885438 L -0.21114562,4.1055728 A 1.236068,1.236068 31.717474 0 1 -2,3 v -6 a 1.236068,1.236068 148.28253 0 1 1.78885438,-1.1055728 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:none"
id="path8-3-1" />
</marker>
<linearGradient
xlink:href="#linearGradient13"
id="linearGradient16"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.93927134,0,6.2326702)"
x1="50.894115"
y1="80.727814"
x2="50.894115"
y2="68.866821" />
</defs>
<rect
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
id="rect16"
width="1280.0001"
height="640"
x="1.1474608e-06"
y="2.8421709e-14" />
<g
id="layer1"
transform="translate(-419.99999)">
<g
id="g13-2"
transform="matrix(4.6783888,0,0,4.6783888,411.42933,-46.143325)">
<text
xml:space="preserve"
transform="matrix(0.26458333,0,0,0.26458333,2.4199432,-2.3937254)"
id="text1-0"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:192px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect1-5);display:inline;fill:url(#linearGradient6-2);stroke-width:7.55906;stroke-dasharray:none"><tspan
x="227.9082"
y="353.41641"
id="tspan1">SMATH</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:8.37934px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#000000;stroke-width:2;stroke-dasharray:none"
x="110.62661"
y="105.75446"
id="text2-1"><tspan
id="tspan2-24"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:8.37934px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Bold Italic';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:2;stroke-dasharray:none"
x="110.62661"
y="105.75446">Linear algebra library for C++23</tspan></text>
<path
style="fill:#000000;stroke:url(#linearGradient11-0);stroke-width:2;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#RoundedArrow-45)"
d="M 50.894116,102.63145 V 56.432683"
id="path4-5" />
<path
style="fill:#000000;stroke:url(#linearGradient16);stroke-width:1.93832;stroke-dasharray:none;stroke-opacity:1"
d="M 50.894116,102.63145 V 59.238272"
id="path4-0-5" />
<path
style="fill:none;stroke:url(#linearGradient9-6);stroke-width:2;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#RoundedArrow-4-1)"
d="m 51.891583,103.63172 h 46.19876"
id="path4-9-23" />
<path
style="fill:#ff0c0c;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
d="m 51.891583,104.63115 v -1.9997 l -1.998196,1.99844 z"
id="path5-2" />
<path
style="fill:#25ff0c;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
d="m 49.895018,102.63082 v 1.9997 l 1.998196,-1.99844 z"
id="path5-8-3" />
<circle
style="fill:#1162ff;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
id="path13-1"
cx="50.894115"
cy="103.6313"
r="3.4155982" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.1 KiB

186
docs/smath_big_dark.svg Normal file
View File

@@ -0,0 +1,186 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="1280"
height="640"
viewBox="0 0 1280.0001 640.00006"
version="1.1"
id="svg1"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1">
<linearGradient
id="linearGradient15">
<stop
style="stop-color:#666666;stop-opacity:1;"
offset="0.27173913"
id="stop14" />
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="1"
id="stop15" />
</linearGradient>
<linearGradient
id="linearGradient13">
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="0"
id="stop12" />
<stop
style="stop-color:#16d800;stop-opacity:1;"
offset="1"
id="stop13" />
</linearGradient>
<linearGradient
id="linearGradient10">
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="0"
id="stop10" />
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="1"
id="stop11" />
</linearGradient>
<linearGradient
id="linearGradient8">
<stop
style="stop-color:#c50000;stop-opacity:1;"
offset="0"
id="stop8" />
<stop
style="stop-color:#ff0c0c;stop-opacity:1;"
offset="1"
id="stop9" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient15"
id="linearGradient6-4-9"
x1="482.5849"
y1="589.83472"
x2="613.15253"
y2="-24.437733"
gradientUnits="userSpaceOnUse" />
<rect
x="227.90907"
y="175.81558"
width="659.85107"
height="227.90907"
id="rect1-9-2" />
<linearGradient
xlink:href="#linearGradient10"
id="linearGradient11-6-9"
x1="50.894115"
y1="80.727814"
x2="50.894115"
y2="68.866821"
gradientUnits="userSpaceOnUse" />
<marker
style="overflow:visible"
id="RoundedArrow-7-9"
refX="0"
refY="0"
orient="auto-start-reverse"
markerWidth="1"
markerHeight="1"
viewBox="0 0 1 1"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.7)"
d="m -0.21114562,-4.1055728 6.42229122,3.21114561 a 1,1 90 0 1 0,1.78885438 L -0.21114562,4.1055728 A 1.236068,1.236068 31.717474 0 1 -2,3 v -6 a 1.236068,1.236068 148.28253 0 1 1.78885438,-1.1055728 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:none"
id="path8-31-8" />
</marker>
<linearGradient
xlink:href="#linearGradient8"
id="linearGradient9-9-6"
x1="107.55984"
y1="103.63171"
x2="51.891579"
y2="103.63171"
gradientUnits="userSpaceOnUse" />
<marker
style="overflow:visible"
id="RoundedArrow-4-8-5"
refX="0"
refY="0"
orient="auto-start-reverse"
markerWidth="1"
markerHeight="1"
viewBox="0 0 1 1"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.7)"
d="m -0.21114562,-4.1055728 6.42229122,3.21114561 a 1,1 90 0 1 0,1.78885438 L -0.21114562,4.1055728 A 1.236068,1.236068 31.717474 0 1 -2,3 v -6 a 1.236068,1.236068 148.28253 0 1 1.78885438,-1.1055728 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:none"
id="path8-3-0-8" />
</marker>
<linearGradient
xlink:href="#linearGradient13"
id="linearGradient18"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.93927134,0,6.2326702)"
x1="50.894115"
y1="80.727814"
x2="50.894115"
y2="68.866821" />
</defs>
<g
id="layer1"
transform="translate(-1710.0001)">
<g
id="g13-6-1"
transform="matrix(4.678389,0,0,4.6783889,1701.4295,-46.143332)">
<g
id="g15-6">
<text
xml:space="preserve"
transform="matrix(0.26458333,0,0,0.26458333,2.4199432,-2.3937254)"
id="text1-5-1"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:192px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect1-9-2);display:inline;fill:url(#linearGradient6-4-9);stroke-width:7.55906;stroke-dasharray:none"><tspan
x="227.9082"
y="353.41641"
id="tspan1">SMATH</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:8.37934px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#d1d1d1;fill-opacity:1;stroke-width:2;stroke-dasharray:none"
x="110.62661"
y="105.75446"
id="text2-4-3"><tspan
id="tspan2-2-2"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:8.37934px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Bold Italic';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#d1d1d1;fill-opacity:1;stroke-width:2;stroke-dasharray:none"
x="110.62661"
y="105.75446">Linear algebra library for C++23</tspan></text>
<path
style="fill:#000000;stroke:url(#linearGradient11-6-9);stroke-width:2;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#RoundedArrow-7-9)"
d="M 50.894116,102.63145 V 56.432683"
id="path4-3-2" />
<path
style="fill:#000000;stroke:url(#linearGradient18);stroke-width:1.93832;stroke-dasharray:none;stroke-opacity:1"
d="M 50.894116,102.63145 V 59.238272"
id="path4-0-1-1" />
<path
style="fill:none;stroke:url(#linearGradient9-9-6);stroke-width:2;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#RoundedArrow-4-8-5)"
d="m 51.891583,103.63172 h 46.19876"
id="path4-9-2-1" />
<path
style="fill:#ff0c0c;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
d="m 51.891583,104.63115 v -1.9997 l -1.998196,1.99844 z"
id="path5-1-1" />
<path
style="fill:#25ff0c;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
d="m 49.895018,102.63082 v 1.9997 l 1.998196,-1.99844 z"
id="path5-8-2-2" />
<circle
style="fill:#1162ff;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
id="path13-5-3"
cx="50.894115"
cy="103.6313"
r="3.4155982" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.2 KiB

193
docs/smath_dark.svg Normal file
View File

@@ -0,0 +1,193 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="200"
height="80"
viewBox="0 0 200.00001 80.000008"
version="1.1"
id="svg1"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1">
<linearGradient
id="linearGradient15">
<stop
style="stop-color:#666666;stop-opacity:1;"
offset="0.27173913"
id="stop14" />
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="1"
id="stop15" />
</linearGradient>
<linearGradient
id="linearGradient13">
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="0"
id="stop12" />
<stop
style="stop-color:#16d800;stop-opacity:1;"
offset="1"
id="stop13" />
</linearGradient>
<linearGradient
id="linearGradient10">
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="0"
id="stop10" />
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="1"
id="stop11" />
</linearGradient>
<linearGradient
id="linearGradient8">
<stop
style="stop-color:#c50000;stop-opacity:1;"
offset="0"
id="stop8" />
<stop
style="stop-color:#ff0c0c;stop-opacity:1;"
offset="1"
id="stop9" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient15"
id="linearGradient6-4"
x1="482.5849"
y1="589.83472"
x2="613.15253"
y2="-24.437733"
gradientUnits="userSpaceOnUse" />
<rect
x="227.90907"
y="175.81558"
width="659.85107"
height="227.90907"
id="rect1-9" />
<linearGradient
xlink:href="#linearGradient10"
id="linearGradient11-6"
x1="50.894115"
y1="80.727814"
x2="50.894115"
y2="68.866821"
gradientUnits="userSpaceOnUse" />
<marker
style="overflow:visible"
id="RoundedArrow-7"
refX="0"
refY="0"
orient="auto-start-reverse"
markerWidth="1"
markerHeight="1"
viewBox="0 0 1 1"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.7)"
d="m -0.21114562,-4.1055728 6.42229122,3.21114561 a 1,1 90 0 1 0,1.78885438 L -0.21114562,4.1055728 A 1.236068,1.236068 31.717474 0 1 -2,3 v -6 a 1.236068,1.236068 148.28253 0 1 1.78885438,-1.1055728 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:none"
id="path8-31" />
</marker>
<linearGradient
xlink:href="#linearGradient8"
id="linearGradient9-9"
x1="107.55984"
y1="103.63171"
x2="51.891579"
y2="103.63171"
gradientUnits="userSpaceOnUse" />
<marker
style="overflow:visible"
id="RoundedArrow-4-8"
refX="0"
refY="0"
orient="auto-start-reverse"
markerWidth="1"
markerHeight="1"
viewBox="0 0 1 1"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.7)"
d="m -0.21114562,-4.1055728 6.42229122,3.21114561 a 1,1 90 0 1 0,1.78885438 L -0.21114562,4.1055728 A 1.236068,1.236068 31.717474 0 1 -2,3 v -6 a 1.236068,1.236068 148.28253 0 1 1.78885438,-1.1055728 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:none"
id="path8-3-0" />
</marker>
<linearGradient
xlink:href="#linearGradient13"
id="linearGradient14"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.93927134,0,6.2326702)"
x1="50.894115"
y1="80.727814"
x2="50.894115"
y2="68.866821" />
</defs>
<rect
style="display:none;fill:#000000;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
id="rect14"
width="200"
height="80"
x="-4.7587887e-06"
y="0" />
<g
id="layer1"
transform="translate(-210)">
<g
id="g13-6"
transform="translate(171.3688,-38.262697)">
<g
id="g15">
<text
xml:space="preserve"
transform="matrix(0.26458333,0,0,0.26458333,2.4199432,-2.3937254)"
id="text1-5"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:192px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect1-9);display:inline;fill:url(#linearGradient6-4);stroke-width:7.55906;stroke-dasharray:none"><tspan
x="227.9082"
y="353.41641"
id="tspan1">SMATH</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:8.37934px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#d1d1d1;fill-opacity:1;stroke-width:2;stroke-dasharray:none"
x="110.62661"
y="105.75446"
id="text2-4"><tspan
id="tspan2-2"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:8.37934px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Bold Italic';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;fill:#d1d1d1;fill-opacity:1;stroke-width:2;stroke-dasharray:none"
x="110.62661"
y="105.75446">Linear algebra library for C++23</tspan></text>
<path
style="fill:#000000;stroke:url(#linearGradient11-6);stroke-width:2;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#RoundedArrow-7)"
d="M 50.894116,102.63145 V 56.432683"
id="path4-3" />
<path
style="fill:#000000;stroke:url(#linearGradient14);stroke-width:1.93832;stroke-dasharray:none;stroke-opacity:1"
d="M 50.894116,102.63145 V 59.238272"
id="path4-0-1" />
<path
style="fill:none;stroke:url(#linearGradient9-9);stroke-width:2;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#RoundedArrow-4-8)"
d="m 51.891583,103.63172 h 46.19876"
id="path4-9-2" />
<path
style="fill:#ff0c0c;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
d="m 51.891583,104.63115 v -1.9997 l -1.998196,1.99844 z"
id="path5-1" />
<path
style="fill:#25ff0c;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
d="m 49.895018,102.63082 v 1.9997 l 1.998196,-1.99844 z"
id="path5-8-2" />
<circle
style="fill:#1162ff;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
id="path13-5"
cx="50.894115"
cy="103.6313"
r="3.4155982" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.3 KiB

182
docs/smath_light.svg Normal file
View File

@@ -0,0 +1,182 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="200"
height="80"
viewBox="0 0 200.00001 80.000008"
version="1.1"
id="svg1"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1">
<linearGradient
id="linearGradient13">
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="0"
id="stop12" />
<stop
style="stop-color:#16d800;stop-opacity:1;"
offset="1"
id="stop13" />
</linearGradient>
<linearGradient
id="linearGradient10">
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="0"
id="stop10" />
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="1"
id="stop11" />
</linearGradient>
<linearGradient
id="linearGradient8">
<stop
style="stop-color:#c50000;stop-opacity:1;"
offset="0"
id="stop8" />
<stop
style="stop-color:#ff0c0c;stop-opacity:1;"
offset="1"
id="stop9" />
</linearGradient>
<linearGradient
id="linearGradient5">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop5" />
<stop
style="stop-color:#969696;stop-opacity:1;"
offset="1"
id="stop6" />
</linearGradient>
<marker
style="overflow:visible"
id="RoundedArrow"
refX="0"
refY="0"
orient="auto-start-reverse"
markerWidth="1"
markerHeight="1"
viewBox="0 0 1 1"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.7)"
d="m -0.21114562,-4.1055728 6.42229122,3.21114561 a 1,1 90 0 1 0,1.78885438 L -0.21114562,4.1055728 A 1.236068,1.236068 31.717474 0 1 -2,3 v -6 a 1.236068,1.236068 148.28253 0 1 1.78885438,-1.1055728 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:none"
id="path8" />
</marker>
<rect
x="227.90907"
y="175.81558"
width="659.85107"
height="227.90907"
id="rect1" />
<marker
style="overflow:visible"
id="RoundedArrow-4"
refX="0"
refY="0"
orient="auto-start-reverse"
markerWidth="1"
markerHeight="1"
viewBox="0 0 1 1"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.7)"
d="m -0.21114562,-4.1055728 6.42229122,3.21114561 a 1,1 90 0 1 0,1.78885438 L -0.21114562,4.1055728 A 1.236068,1.236068 31.717474 0 1 -2,3 v -6 a 1.236068,1.236068 148.28253 0 1 1.78885438,-1.1055728 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:none"
id="path8-3" />
</marker>
<linearGradient
xlink:href="#linearGradient5"
id="linearGradient6"
x1="482.5849"
y1="589.83472"
x2="613.15253"
y2="-24.437733"
gradientUnits="userSpaceOnUse" />
<linearGradient
xlink:href="#linearGradient8"
id="linearGradient9"
x1="107.55984"
y1="103.63171"
x2="51.891579"
y2="103.63171"
gradientUnits="userSpaceOnUse" />
<linearGradient
xlink:href="#linearGradient10"
id="linearGradient11"
x1="50.894115"
y1="80.727814"
x2="50.894115"
y2="68.866821"
gradientUnits="userSpaceOnUse" />
<linearGradient
xlink:href="#linearGradient13"
id="linearGradient12"
gradientUnits="userSpaceOnUse"
x1="50.894115"
y1="80.727814"
x2="50.894115"
y2="68.866821"
gradientTransform="matrix(1,0,0,0.93927134,0,6.2326702)" />
</defs>
<g
id="layer1">
<g
id="g13"
transform="translate(-38.631211,-38.262697)">
<text
xml:space="preserve"
transform="matrix(0.26458333,0,0,0.26458333,2.4199432,-2.3937254)"
id="text1"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:192px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect1);display:inline;fill:url(#linearGradient6);stroke-width:7.55906;stroke-dasharray:none"><tspan
x="227.9082"
y="353.41641"
id="tspan3">SMATH</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:8.37934px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#000000;stroke-width:2;stroke-dasharray:none"
x="110.62661"
y="105.75446"
id="text2"><tspan
id="tspan2"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:8.37934px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Bold Italic';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:2;stroke-dasharray:none"
x="110.62661"
y="105.75446">Linear algebra library for C++23</tspan></text>
<path
style="fill:#000000;stroke:url(#linearGradient11);stroke-width:2;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#RoundedArrow)"
d="M 50.894116,102.63145 V 56.432683"
id="path4" />
<path
style="fill:#000000;stroke:url(#linearGradient12);stroke-width:1.93832;stroke-dasharray:none;stroke-opacity:1"
d="M 50.894116,102.63145 V 59.238272"
id="path4-0" />
<path
style="fill:none;stroke:url(#linearGradient9);stroke-width:2;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#RoundedArrow-4)"
d="m 51.891583,103.63172 h 46.19876"
id="path4-9" />
<path
style="fill:#ff0c0c;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
d="m 51.891583,104.63115 v -1.9997 l -1.998196,1.99844 z"
id="path5" />
<path
style="fill:#25ff0c;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
d="m 49.895018,102.63082 v 1.9997 l 1.998196,-1.99844 z"
id="path5-8" />
<circle
style="fill:#1162ff;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
id="path13"
cx="50.894115"
cy="103.6313"
r="3.4155982" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -185,7 +185,6 @@ int main()
Mapper mp(W, H, scale);
int pr_axes = 1;
auto [cx, cy] = mp.map({ 0, 0 });
cvs.hline(H / 2, '-', pr_axes, CLR_AXES);
cvs.vline(W / 2, '|', pr_axes, CLR_AXES);
cvs.put(W / 2, H / 2, 'O', pr_axes + 1, CLR_AXES);

View File

@@ -33,6 +33,10 @@
#include <type_traits>
#ifndef SMATH_ANGLE_UNIT
/**
* @brief Angle unit to be used for the actual values. Can be rad, deg, or
* turns.
*/
#define SMATH_ANGLE_UNIT rad
#endif // SMATH_ANGLE_UNIT
@@ -46,8 +50,10 @@ struct Vec;
namespace detail
{
/// \cond DO_NOT_DOCUMENT
#define SMATH_STR(x) #x
#define SMATH_XSTR(x) SMATH_STR(x)
/// \endcond
consteval auto streq(const char *a, const char *b) -> bool
{
@@ -212,6 +218,8 @@ public:
// Member accesses
// NOTE: This can (probably) be improved with C++26 reflection in the
// future.
/// \cond DO_NOT_DOCUMENT
#define VEC_ACC(component, req, idx) \
constexpr auto component() noexcept -> T &requires(N >= req) { \
return (*this)[idx]; \
@@ -239,6 +247,7 @@ public:
VEC_ACC(u, 1, 0)
VEC_ACC(v, 2, 1)
#undef VEC_ACC
/// \endcond
template<class... Args, std::size_t... Is>
constexpr void unpack_impl(
@@ -287,6 +296,7 @@ public:
}
// Members
/// \cond DO_NOT_DOCUMENT
#define VEC_OP(op) \
constexpr auto operator op(Vec const &rhs) const noexcept -> Vec \
{ \
@@ -327,6 +337,7 @@ public:
VEC_OP_ASSIGN(*)
VEC_OP_ASSIGN(/)
#undef VEC_OP_ASSIGN
/// \endcond
constexpr auto operator==(Vec const &v) const noexcept -> bool
{

190
smath_big.svg Normal file
View File

@@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="1280"
height="640"
viewBox="0 0 1280.0001 640.00006"
version="1.1"
id="svg1"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1">
<linearGradient
id="linearGradient13">
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="0"
id="stop12" />
<stop
style="stop-color:#16d800;stop-opacity:1;"
offset="1"
id="stop13" />
</linearGradient>
<linearGradient
id="linearGradient10">
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="0"
id="stop10" />
<stop
style="stop-color:#25ff0c;stop-opacity:1;"
offset="1"
id="stop11" />
</linearGradient>
<linearGradient
id="linearGradient8">
<stop
style="stop-color:#c50000;stop-opacity:1;"
offset="0"
id="stop8" />
<stop
style="stop-color:#ff0c0c;stop-opacity:1;"
offset="1"
id="stop9" />
</linearGradient>
<linearGradient
id="linearGradient5">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop5" />
<stop
style="stop-color:#969696;stop-opacity:1;"
offset="1"
id="stop6" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient5"
id="linearGradient6-2"
x1="482.5849"
y1="589.83472"
x2="613.15253"
y2="-24.437733"
gradientUnits="userSpaceOnUse" />
<rect
x="227.90907"
y="175.81558"
width="659.85107"
height="227.90907"
id="rect1-5" />
<linearGradient
xlink:href="#linearGradient10"
id="linearGradient11-0"
x1="50.894115"
y1="80.727814"
x2="50.894115"
y2="68.866821"
gradientUnits="userSpaceOnUse" />
<marker
style="overflow:visible"
id="RoundedArrow-45"
refX="0"
refY="0"
orient="auto-start-reverse"
markerWidth="1"
markerHeight="1"
viewBox="0 0 1 1"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.7)"
d="m -0.21114562,-4.1055728 6.42229122,3.21114561 a 1,1 90 0 1 0,1.78885438 L -0.21114562,4.1055728 A 1.236068,1.236068 31.717474 0 1 -2,3 v -6 a 1.236068,1.236068 148.28253 0 1 1.78885438,-1.1055728 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:none"
id="path8-2" />
</marker>
<linearGradient
xlink:href="#linearGradient8"
id="linearGradient9-6"
x1="107.55984"
y1="103.63171"
x2="51.891579"
y2="103.63171"
gradientUnits="userSpaceOnUse" />
<marker
style="overflow:visible"
id="RoundedArrow-4-1"
refX="0"
refY="0"
orient="auto-start-reverse"
markerWidth="1"
markerHeight="1"
viewBox="0 0 1 1"
preserveAspectRatio="xMidYMid">
<path
transform="scale(0.7)"
d="m -0.21114562,-4.1055728 6.42229122,3.21114561 a 1,1 90 0 1 0,1.78885438 L -0.21114562,4.1055728 A 1.236068,1.236068 31.717474 0 1 -2,3 v -6 a 1.236068,1.236068 148.28253 0 1 1.78885438,-1.1055728 z"
style="fill:context-stroke;fill-rule:evenodd;stroke:none"
id="path8-3-1" />
</marker>
<linearGradient
xlink:href="#linearGradient13"
id="linearGradient16"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.93927134,0,6.2326702)"
x1="50.894115"
y1="80.727814"
x2="50.894115"
y2="68.866821" />
</defs>
<rect
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
id="rect16"
width="1280.0001"
height="640"
x="1.1474608e-06"
y="2.8421709e-14" />
<g
id="layer1"
transform="translate(-419.99999)">
<g
id="g13-2"
transform="matrix(4.6783888,0,0,4.6783888,411.42933,-46.143325)">
<text
xml:space="preserve"
transform="matrix(0.26458333,0,0,0.26458333,2.4199432,-2.3937254)"
id="text1-0"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:192px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect1-5);display:inline;fill:url(#linearGradient6-2);stroke-width:7.55906;stroke-dasharray:none"><tspan
x="227.9082"
y="353.41641"
id="tspan1">SMATH</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:8.37934px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#000000;stroke-width:2;stroke-dasharray:none"
x="110.62661"
y="105.75446"
id="text2-1"><tspan
id="tspan2-24"
style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:8.37934px;font-family:'Shree Devanagari 714';-inkscape-font-specification:'Shree Devanagari 714, Bold Italic';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;stroke-width:2;stroke-dasharray:none"
x="110.62661"
y="105.75446">Linear algebra library for C++23</tspan></text>
<path
style="fill:#000000;stroke:url(#linearGradient11-0);stroke-width:2;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#RoundedArrow-45)"
d="M 50.894116,102.63145 V 56.432683"
id="path4-5" />
<path
style="fill:#000000;stroke:url(#linearGradient16);stroke-width:1.93832;stroke-dasharray:none;stroke-opacity:1"
d="M 50.894116,102.63145 V 59.238272"
id="path4-0-5" />
<path
style="fill:none;stroke:url(#linearGradient9-6);stroke-width:2;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#RoundedArrow-4-1)"
d="m 51.891583,103.63172 h 46.19876"
id="path4-9-23" />
<path
style="fill:#ff0c0c;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
d="m 51.891583,104.63115 v -1.9997 l -1.998196,1.99844 z"
id="path5-2" />
<path
style="fill:#25ff0c;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
d="m 49.895018,102.63082 v 1.9997 l 1.998196,-1.99844 z"
id="path5-8-3" />
<circle
style="fill:#1162ff;fill-opacity:1;stroke:none;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
id="path13-1"
cx="50.894115"
cy="103.6313"
r="3.4155982" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -116,6 +116,7 @@ TEST(Vec, NormalizeAndSafeNormalize)
auto n = v.normalized();
auto ns = v.normalized_safe();
ExpectVecNear(n, Vec3 { 1.0f, 0.0f, 0.0f });
ExpectVecNear(ns, Vec3 { 1.0f, 0.0f, 0.0f });
Vec3 zero {};
auto zs = zero.normalized_safe();