Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1346)

Issue 305380043: Convert a bunch of C++ internals to degrees rather than radians (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 7 months ago by dak
Modified:
5 years, 8 months ago
Reviewers:
thomasmorley651, carl.d.sorensen, Carl
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Convert a bunch of C++ internals to degrees rather than radians Degrees make for more "predictable" results in graphics applications when care is taken to work as exactly as possible in the vicinity of multiples of 45 degrees. This provides also functions ly:length, ly:directed and ly:angle to Scheme in order to facilitate work in degrees there. A number of operations relevant only to complex analysis/arithmetic rather than vector operations are removed from the Offset type in order not to encourage their use. Contains commits: Remove complex{conjugate,divide,exp}, Offset::arg They are promoting aspects of Offset not well-suited to graphics. Let make_partial_ellipse_boxes use degrees Change rotations to degrees rather than radians Or replace them with something not requiring angles altogether. Simplify polar->rectangular Add ly:length, ly:directed, ly:angle Those are functions working on and/or producing coordinate pairs, usually based on angles expressed in degrees. Add offset_directed (Real) This converts an angle in degrees into a unit vector. Make Offset::angle_degrees () deliver nicer angles Multiples of 45 degrees should be returned exactly.

Patch Set 1 #

Total comments: 2

Patch Set 2 : Allow ly:directed to take a 2D magnitude #

Unified diffs Side-by-side diffs Delta from patch set Stats (+186 lines, -64 lines) Patch
M flower/include/offset.hh View 2 chunks +1 line, -3 lines 0 comments Download
M flower/offset.cc View 2 chunks +90 lines, -31 lines 0 comments Download
M lily/arpeggio.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/bezier.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M lily/include/bezier.hh View 1 chunk +1 line, -1 line 0 comments Download
M lily/line-interface.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/lookup.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M lily/slur-configuration.cc View 1 chunk +1 line, -1 line 0 comments Download
M lily/slur-scoring.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/stencil.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M lily/stencil-integral.cc View 5 chunks +7 lines, -8 lines 0 comments Download
M lily/stencil-scheme.cc View 1 1 chunk +72 lines, -0 lines 0 comments Download
M scm/lily-library.scm View 1 1 chunk +2 lines, -8 lines 0 comments Download

Messages

Total messages: 4
thomasmorley651
As always, can't judge C++ -code. Though, I've gone through the doc-strings, from that and ...
7 years, 7 months ago (2016-08-29 22:15:39 UTC) #1
Carl
LGTM. Nicely done.
7 years, 7 months ago (2016-08-30 02:05:23 UTC) #2
dak
https://codereview.appspot.com/305380043/diff/1/scm/lily-library.scm File scm/lily-library.scm (right): https://codereview.appspot.com/305380043/diff/1/scm/lily-library.scm#newcode779 scm/lily-library.scm:779: as rectangular coordinates @ode{(x-length . y-length)}." On 2016/08/29 22:15:39, ...
7 years, 7 months ago (2016-08-30 09:34:01 UTC) #3
dak
7 years, 7 months ago (2016-08-30 11:04:48 UTC) #4
Allow ly:directed to take a 2D magnitude
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b