circ2poly

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 4.5, Creation date: 2019-03-13, Last change: 2025-09-14

ratio of polygon radius between if turned pi/n radiands

Description

same as dofn

See Also: dofn , sofrd , phiofsr , nofrd

Example Illustration

 missing image of circ2poly(n,r)

Syntax

m=circ2poly(n,[r])

Input Parameter

n: number of polygon edges/corners
r: optional radius

Output Parameter

m: magnification >1

Examples


circ2poly(6)




Copyright 2019-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, circ2poly, calculates the magnification factor for a regular polygon inscribed in a circle. The function is part of the SolidGeometry library and was introduced in version 4.5. It is designed to determine the ratio of the polygon's radius when rotated by À/n radians.

Input Parameters

Output Results

Algorithm Steps

  1. The function begins by retrieving the radius r using the helper function getfuncparams. If r is not provided, a default value of 1 is assumed.
  2. The magnification factor m is calculated as 1/cos(pi/n). This formula derives from the geometric properties of a regular polygon inscribed in a circle.
  3. The sine of the angle pi/n is computed and stored in s.
  4. The length l is calculated as r * m * s, which represents a specific geometric property related to the polygon.
  5. If no output arguments are specified, the function proceeds to visualize the results:

The function is designed to provide both a numerical result and a visual representation of the geometric transformation, aiding in the understanding of the relationship between a circle and its inscribed polygon.

Algorithm explaination created using ChatGPT on 2025-08-19 00:23. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21