Skip to content

Improve accuracy of polytopes.regular_polygon() #17131

Closed
@jdemeyer

Description

@jdemeyer

The function polytopes.regular_polygon() uses a hard-coded approximation of pi (3.14159265359) which has an error of 466 ulp. Moreover, it uses Python floats instead of RR.

Note: there are actually a lot of these fishy approximations (like QQ(1618033)/1000000 for the golden ratio). Since this ticket is intended to avoid a doctest failure in #17130, I only fixed regular_polygon().

Component: geometry

Author: Jeroen Demeyer

Branch/Commit: 0001941

Reviewer: Volker Braun

Issue created by migration from https://trac.sagemath.org/ticket/17131

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions