This might be helpful if design own hour and minutes hands for a watch.
Having a green laser sword and want to rotate it on my Bangle.js around xm=120 and ym=120.
// width : 15, height : 106, bpp : 8,
var greenLaser =
require("heatshrink").decompress(atob("h9qxH+AAvW1my64KGAAXX1eGwwOK2NasFaw3WBxVhsAOe2QOI1dgsI7BBxHWByIsKDqeFBxOHBwNhBxodK2WGO4QOaHZgOF1gOMsOxBzdgBxOFBwZKJByVaBzJYCrRKJBoQOLOwYOKYIIOR1YOO64ON6wOLsAONDpOrNAYdJ2IOM6+xHYmHByvW1YOEwwOOcIwOQLIgdXw7vEBxodI2WGB0WFBxBZEBx+sFhoOIDodhBxGFDoYABBzlgBxtaNA4YBBxg6FBxNgrQADfxGr2QAEBwoAO6+sAAvXBo1WAAeBqwQBBwmBgAAFqweCFIVWBw4vCBgUrBw0rlYQBFI4AFwIPBIgIACJIRODJgJlGAAqEQCQIsDAAodCM5BaCByIPBFhLQSM5S0DwKbBAAxZEWQ4ACBwaeEDpA8KK6R1JUobvOfx4OqNgIO/B34O/Bx7gClYOLwIdOwNWDxFWq2s/3X69WF4gDBBgINBAAPXF4+B64NCAAIvBAAobD"));
const p180 = Math.PI/180;
// three o'clock : 90°
var a = 90;
g.drawImage(greenLaser,120,120,{rotate:a*p180});
As the image center is not the center you like as center for your rotation it it necessary to add some corrections . The new center in this case is centerX/Y =121 which is a rotation on a circle xm=120, ym=120, r=21
const p180 = Math.PI/180;
var a = 90;
var r =21;
var x = r * Math.sin(a*p180);
var y = r * Math.cos(a*p180);
g.drawCircle(120,120,21);
g.drawImage(greenLaser,120+x,120+y,{rotate:a*p180});
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
Tips:
Create headers by underlining text with ==== or ----
To *italicise* text put one asterisk each side of the word
To **bold** text put two asterisks each side of the word
Embed images by entering: ![](https://www.google.co.uk/images/srpr/logo4w.png) That's the hard one: exclamation, square brackets and then the URL to the image in brackets.
* Create lists by starting lines with asterisks
1. Create numbered lists by starting lines with a number and a dot
> Quote text by starting lines with >
Mention another user by @username
For syntax highlighting, surround the code block with three backticks:
```
Your code goes here
```
Just like Github, a blank line must precede a code block.
If you upload more than 5 files we will display all attachments as thumbnails.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
This might be helpful if design own hour and minutes hands for a watch.
Having a green laser sword and want to rotate it on my Bangle.js around xm=120 and ym=120.
As the image center is not the center you like as center for your rotation it it necessary to add some corrections . The new center in this case is centerX/Y =121 which is a rotation on a circle xm=120, ym=120, r=21
3 Attachments