Learn R Programming

cycloids (version 1.0.2)

npeaks: Calculates the number of a cycloid's peaks based on the radii A (fixed circle) and a (moving circle)

Description

This function may be useful for calculating the number \(n\) of peaks a cycloid (zykloid) based on the radii \(A\) (fixed circle) and \(a\) (moving circle) will have. The equation for \(n\) is

\(n = kgV(A, a)/a\)

where \(kgV(A, a)\) is the least common multiple of \(A\) and \(a\) as implemented in the function kgV

Usage

npeaks(A, a)

Value

A natural number if \(A\) and \(a\) are natural numbers. In any other case, the function returns NA.

Arguments

A

A natural number (integer value > 0)

a

A natural number (integer value > 0)

Author

Peter Biber

See Also

kgV, ggT, zykloid

Examples

Run this code

npeaks(18, 6)      #  3
npeaks(38, 105)    # 38
npeaks(36, 9)      #  4
npeaks(12, 9)      #  4
npeaks(9, 12)      #  3
npeaks(-5, 12)     # NA - only integer numbers > 0 allowed
npeaks(3, 0)       # NA - only integer numbers > 0 allowed
npeaks(3.2, 12)    # NA - only integer numbers > 0 allowed

Run the code above in your browser using DataLab