func (c ChordAngle) Predecessor() ChordAngle {
	if c <= 0 {
		return NegativeChordAngle
	}
	if c > maxLength2 {
		return StraightChordAngle
	}
	return ChordAngle(math.Nextafter(float64(c), -10.0))
}
Predecessor returns the largest representable ChordAngle less than this one.

Note the following special cases:
InfChordAngle.Predecessor == StraightChordAngle
ChordAngle(0).Predecessor == NegativeChordAngle
NegativeChordAngle.Predecessor == NegativeChordAngle
package s1
import (
	"math"
)
type ChordAngle float64
const (
	NegativeChordAngle = ChordAngle(-1)
	RightChordAngle = ChordAngle(2)
	StraightChordAngle = ChordAngle(4)
	maxLength2 = 4.0
)
func ChordAngleFromAngle(a Angle) ChordAngle {
	if a < 0 {
		return NegativeChordAngle
	}
	if a.isInf() {
		return InfChordAngle()
	}
	l := 2 * math.Sin(0.5*math.Min(math.Pi, a.Radians()))
	return ChordAngle(l * l)
}
func ChordAngleFromSquaredLength(length2 float64) ChordAngle {
	if length2 > maxLength2 {
		return StraightChordAngle
	}
	return ChordAngle(length2)
}
func (c ChordAngle) Expanded(e float64) ChordAngle {
	if c.isSpecial() {
		return c
	}
	return ChordAngle(math.Max(0.0, math.Min(maxLength2, float64(c)+e)))
}
func (c ChordAngle) Angle() Angle {
	if c < 0 {
		return -1 * Radian
	}
	if c.isInf() {
		return InfAngle()
	}
	return Angle(2 * math.Asin(0.5*math.Sqrt(float64(c))))
}
func InfChordAngle() ChordAngle {
	return ChordAngle(math.Inf(1))
}
func (c ChordAngle) isInf() bool {
	return math.IsInf(float64(c), 1)
}
func (c ChordAngle) isSpecial() bool {
	return c < 0 || c.isInf()
}
func (c ChordAngle) isValid() bool {
	return (c >= 0 && c <= maxLength2) || c.isSpecial()
}
func (c ChordAngle) Successor() ChordAngle {
	if c >= maxLength2 {
		return InfChordAngle()
	}
	if c < 0 {
		return 0
	}
	return ChordAngle(math.Nextafter(float64(c), 10.0))
}