about | help | code help+videos | done | prefs |
reflect
Given the vertices of a polygon and a string "X" or "Y" representing the axis, return the vertices of its reflection across the specified axis. Input L1 is the list of x-coordinates, and input L2 is the list of corresponding y-coordinates. Return the result as a list containing two items: the list of x-coordinates followed by the list of corresponding y-coordinates for the reflected polygon. reflect([1, 3, 6], [5, 1, 2], 'X') → [[1, 3, 6], [-5, -1, -2]] reflect([0, 7, 0], [0, 0, 7], 'Y') → [[0, -7, 0], [0, 0, 7]] reflect([-1, -3, -6], [-5, -1, -2], 'Y') → [[1, 3, 6], [-5, -1, -2]] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 150 Post-solution available
Copyright Nick Parlante 2017 - privacy