import _ from 'lodash';
import '../../globals.js';
// Copyright 2014-2022, University of Colorado Boulder
/**
 * Star shape (full, 5-pointed)
 *
 * @author Sam Reid (PhET Interactive Simulations)
 */
import { Shape } from '../../kite/js/imports.js';
import optionize from '../../phet-core/js/optionize.js';
import sceneryPhet from './sceneryPhet.js';
export default class StarShape extends Shape {
    constructor(providedOptions) {
        const options = optionize()({
            // SelfOptions
            outerRadius: 15,
            innerRadius: 7.5,
            numberStarPoints: 5
        }, providedOptions);
        super();
        const numSegments = 2 * options.numberStarPoints; // number of segments
        // start at the top and proceed clockwise
        _.times(numSegments, i => {
            const angle = i / numSegments * Math.PI * 2 - Math.PI / 2;
            const radius = i % 2 === 0 ? options.outerRadius : options.innerRadius;
            this.lineTo(radius * Math.cos(angle), radius * Math.sin(angle));
        });
        this.close();
        this.makeImmutable(); // So Paths won't need to add listeners
    }
}
sceneryPhet.register('StarShape', StarShape);
//# sourceMappingURL=StarShape.js.map