Category:Templates to categorize mathematical objects by size

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Most of these template take one argument, and just pass it on. E.g. {{Cayley tables by order|8}} in Cayley tables of order 8 produces:

[[Category:Cayley tables by order| 00008]]
[[Category:Groups of order 8]]
[[Category:8×8 matrices]]

Some make operations like addition, e.g. {{Star graphs by size|5}} in Star graph S5 produces:

[[Category:Star graphs by size| 00005]]
[[Category:Graphs with 6 vertices]]

Some take two arguments, e.g. Template:MatrixCat and Template:Duoprisms by size. Both calculate the product of the arguments, and check if they are equal.

Some map numbers to words, e.g. {{PolygonCat|13}} will output [[Category:Tridecagons]].




Sometimes switch has to be used to catch special cases. E.g. Regular pentagons is not directly in Pentagons, but via Equilateral pentagons and Equiangular pentagons. The code in Template:Regular polygons by size looks like this:

{{#switch: {{{1}}}
| 5 = [[Category:Equilateral pentagons]][[Category:Equiangular pentagons]]
| {{PolygonCat|{{{1}}}}}
}}

The same templates sorts into angle categories if the angle is an integer:

{{#switch: {{mod|360|{{{1}}}}}
| 0 = [[Category:{{#expr:360/{{{1}}}}}°]][[Category:{{#expr:180-360/{{{1}}}}}°]]
}}

Actually there is another switch within that, because 90° is at Right angles:

{{#switch: {{mod|360|{{{1}}}}}
| 0 = {{#switch: {{#expr:180-360/{{{1}}}}} | 90 = [[Category:Right angles]] | [[Category:{{#expr:360/{{{1}}}}}°]][[Category:{{#expr:180-360/{{{1}}}}}°]]}}
}}




There are no other groups of prime order than cyclic groups. Unfortunately there seems to be no template that checks if a number is prime. So {{Cycle graphs of cyclic groups by size}} includes this poor solution, sorting e.g. Cycle graph of C7 directly in Group cycle graphs by order:

{{#switch: {{{1}}}
| 2 = [[Category:Group cycle graphs by order| {{padleft:{{{1}}}|5}}]]
| 3 = [[Category:Group cycle graphs by order| {{padleft:{{{1}}}|5}}]]
| 5 = [[Category:Group cycle graphs by order| {{padleft:{{{1}}}|5}}]]
| 7 = [[Category:Group cycle graphs by order| {{padleft:{{{1}}}|5}}]]
| 11 = [[Category:Group cycle graphs by order| {{padleft:{{{1}}}|5}}]]
| 13 = [[Category:Group cycle graphs by order| {{padleft:{{{1}}}|5}}]]
| [[Category:Group cycle graphs of order {{{1}}}]]
}}


See also: Category:Commons utility templates, Category:Mathematical function templates