Constructs a GoldenRatioLengths structure from the provided value for a.
Constructs a GoldenRatioLengths structure from the provided value for AB.
Constructs a GoldenRatioLengths structure from the provided value for b.
This is the optional library-provided main() function for the built-in calculator app.
Portable entrypoint of the command-line calculator app.
The golden ratio.
Golden ratio line segment lengths.
Math library providing constants and functions for working with the golden ratio.
Command-line calculator app
To build the command-line app for the golden ratio calculator, run one of the following commands.
A short help text with usage instructions can be printed by running the command-line app with argument --help.
Terminology
In mathematics, the golden ratio — usually denoted by Greek lowercase letter phi φ — is the partitioning ratio of a line segment in two subsegments that share the same ratio to each other as the combined line segment to the longer subsegment.
The golden ratio can be calculated using the positive solution of following formula:
From this it follows that for a line segment AB the longer subsegment a can be calculated with this formula:
The shorter subsegment b of a line segment AB is therefore calculated as follows: