Last active
January 13, 2023 15:23
-
-
Save TechieBlossom/978f535f1531341e577fb6e0c0027ed1 to your computer and use it in GitHub Desktop.
Generate 6 offsets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (int i = 0; i < 6; i++) { | |
final degree = 60 * i; | |
canvas.drawLine( | |
Offset( | |
radius * cos(pi * 2 * degree / 360) + center.dx, | |
radius * sin(pi * 2 * degree / 360) + center.dy, | |
), | |
Offset( | |
radius * cos(pi * 2 * (degree + 60) / 360) + center.dx, | |
radius * sin(pi * 2 * (degree + 60) / 360) + center.dy, | |
), | |
borderPaint, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment