dofn

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 1.0, Creation date: 2012-12-15, Last change: 2025-09-14

returns the radius relation between a radius and a n-polygon

Description

Similar concept as nofrd. If a polygon is created instead of a real circle, either the edges or the points have not the correct distance to the origin.

See Also: nofrd , sofrd , phiofsr , circ2poly

Example Illustration

 missing image of dofn(n)

Syntax

[m,id]=dofn(n)

Input Parameter

n: number of edges

Output Parameter

m: magnification of the point distance
id: 1/d reduction of the edge distance

Examples


dofn(6)




Copyright 2012-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, dofn, calculates the relationship between the radius of a circle and the radius of a regular n-sided polygon inscribed in the circle. It is part of the SolidGeometry library and was introduced by Tim Lueth.

Input Parameters

Output Results

Algorithm Steps

  1. Check if n is empty or zero. If so, set m and id to 1 and return.
  2. Calculate m as 1/cos(pi/n), which represents the magnification of the point distance.
  3. Calculate id as 1/m, which is the reduction of the edge distance.
  4. If no output arguments are specified, call the function circ2poly(n) to visualize the polygon.

Example

Calling dofn(6) will calculate the magnification and reduction factors for a hexagon.

Algorithm explaination created using ChatGPT on 2025-08-18 23: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