[added] toPolar operator

Authored by appsforartists on Nov 1 2017, 8:33 PM.

Description

[added] toPolar operator

Summary:
This is useful for building marking menus. Like distanceFrom, it accepts an origin$ argument, which allows us to ensure it can only be called on Observable<Point2D>. (Another solution would have been point$.subtractedBy(origin$).toPoint(), but without the argument, we can't constrain T).

I inlined the Pythagorean theorem rather than returning combineLatest({ distance: this.distanceFrom(origin$), angle: … }) to avoid emitting separately for each of distance and angle.

Part of https://github.com/material-motion/material-motion-js/issues/231

Reviewers: O2 Material Motion, O3 Material JavaScript platform reviewers, Material Motion

Tags: Material Motion

Differential Revision: http://codereview.cc/D3444

Details

Committed
appsforartistsJun 1 2018, 6:35 PM
Differential Revision
D3444: [added] toPolar operator
Parents
R13:ea01c11f0b64: [fixed] icons being selected as text
Branches
Unknown
Tags
Unknown