MCPcopy Create free account
hub / github.com/cinder/Cinder / generate

Method generate

src/cinder/Path2d.cpp:678–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

676 }
677
678 std::pair<vec2, vec2> generate( const Point &previous ) const
679 {
680 const auto offset = 4 * math<float>::tan( ( theta - previous.theta ) / 4 ) / 3;
681 const auto p1 = vec2( math<float>::cos( previous.tangent ) * offset * previous.theta + previous.x, math<float>::sin( previous.tangent ) * offset * previous.theta + previous.y );
682 const auto p2 = vec2( math<float>::cos( tangent - float( M_PI ) ) * offset * theta + x, math<float>::sin( tangent - float( M_PI ) ) * offset * theta + y );
683 return std::make_pair( p1, p2 );
684 }
685 };
686
687 const auto step = spacing / ( 2.0f * float( M_PI ) );

Callers 1

spiralMethod · 0.80

Calls 3

tanFunction · 0.85
cosFunction · 0.85
sinFunction · 0.85

Tested by

no test coverage detected