Pendulum Art Avatars

by SirCalcsALot, Nov 30, 2020, 2:12 AM

Hello! :D

I've got some more simulations of pendulum art, and I decided to turn some of the results into avatars. Feel free to use any that you like! :) You can save images by right clicking on them and pressing 'Save Image As..' (at least, that's how it works on chrome).

Here are the 10 avatars I created. The sizes are a bit off, but I tested that these all work as avatars.

#1:
https://cdn.artofproblemsolving.com/attachments/e/7/b23d2f4544dc30a9f769c6d65ff86ab1a895c7.png

#2:
https://cdn.artofproblemsolving.com/attachments/c/9/0da883ed8fb70227226d8f0d6d90e8bd120ff5.png

#3:
https://cdn.artofproblemsolving.com/attachments/a/6/cc5d786a0f30d7d78437fe7646cff0c13bca99.png

#4:
https://cdn.artofproblemsolving.com/attachments/7/f/360b93f61b1316531703e81745accaf64d6c3c.png

#5:
https://cdn.artofproblemsolving.com/attachments/7/7/39099fe87c847c7b9d2de217f1d3a4ac56a52f.png

#6:
https://cdn.artofproblemsolving.com/attachments/6/b/22f918aaaa05682994f30dd37a7cc3a7b0a6e9.png

#7:
https://cdn.artofproblemsolving.com/attachments/b/e/78aa9ffd0568ed00f7cb440439b48f834c4ccf.png

#8:
https://cdn.artofproblemsolving.com/attachments/0/6/a24781245dbaf338d442104fe6dafbdd394c75.png

#9:
https://cdn.artofproblemsolving.com/attachments/f/0/4cb716b84237b57f428d5dbb87da6080eeb00f.png

#10:
https://cdn.artofproblemsolving.com/attachments/a/0/eaa807489a9732b28096e0e50e5adc7500bb7f.png

If you have a specific orientation or colors that are not shown, let me know in the comments and I might be able to make a custom avatar for you. ;)

Virtual Pendulum Art

by SirCalcsALot, Nov 26, 2020, 4:56 AM

Hi all!

It's been a while since I've posted, but I've gotten busy with college and haven't had a chance to mess with the night vision project too much. In the meanwhile, I thought I would share the results of some code I wrote (with a teammate) for my Programming for Physicists class.
https://media.discordapp.net/attachments/745759430175621162/781036154535018506/animation.gif

As you can see above, we are working on building a computational model for pendulum art. Based on the results we have achieved, I think we need to move from writing code to to writing our presentation slides... :|

It's pretty cool what you can do with 300 lines of C++ code and 60 lines of Python code. :)

I made night vision!1!!!iI!i!

by SirCalcsALot, Oct 17, 2020, 7:04 PM

Yay, the parts I've been waiting for finally came. After a bit of time tinkering with the parts, computer code, circuit diagrams, and tape, my first night vision prototype is complete.

Introducing: Night Vision Beta Version Prototype v.1.-1
https://cdn.artofproblemsolving.com/attachments/6/5/b74d4b088e2873559e174760a5c3e96e9f33d6.jpg

Don't try this at home. For those who are curious on how it's built, see the instructional image below (more details coming out in a later post, maybe).
https://cdn.artofproblemsolving.com/attachments/7/2/b9b2c3ef8e827433ddf4b327268fea907fa451.jpg

Now, here are some images of the night vision in action.

First, here are my cats. (Note that ultrasound doesn't bounce well off kitties which is why the range isn't accurate.) G.G.Otto says that I was blasting them with sound and light and they don't even know. :evilgrin:
https://cdn.artofproblemsolving.com/attachments/e/5/f35fd963f6c91b263ddf5202ea887f22bfc82c.jpg

Next, a lawnmower that's been sitting in my yard for so long we had to weedwack around it. (Notice that ultrasound does bounce nicely off broken down lawnmowers...)
https://cdn.artofproblemsolving.com/attachments/1/6/6e8d91232f26ae67ee17d7338a7fdf0d62dda3.jpg

Finally, here's my jungle. There probably is 96 ft 7 in off empty space in front of me, so I guess the range finder works?!?
https://cdn.artofproblemsolving.com/attachments/4/5/f9cca54018ea25e3707ba1fd2c57d6a2607219.jpg

Stay safe, and see you next time!

(Inspiration for this project came from Star Wars: the Mandalorian. Sadly, cheap thermal cameras are out of stock due to covid.)

A code to make a code to make a code...

by SirCalcsALot, Aug 15, 2020, 9:08 PM

Hi everyone! It's been a while since my last post, but I finally finished another project I can share.

I saw a post by sonone on the LaTeX and Asymptote that showed a random QR code made with Asymptote. Since QR codes have certain rules, so I thought I'd attempt at making a scannable QR code with Asymptote. It turns out Python was easier to work with, so I implemented the main algorithm with and had Python print the Asymptote code to draw the QR code. And that's where the title of my post comes in, I made a Python code to write Asymptote code to draw a QR code. :o

Anyway, here is the code for anyone curious: QR Code Generator. To use the code, simply run the program and enter a valid string that is less than 45 characters in length. You can only enter strings with valid characters: 0-9, A-Z (capital only), and a few special characters such as :, /, ., and +. For this, reason the QR code is a little limited in the types of urls you can link with it. I ended up having to use a link shorten (bit.ly to be precise) to get links to certain websites to work.

To actually generate the QR codes, I used this tutorial. My QR code generator is just the tip of the iceberg! The code is a bit long since I ended up using a lot of dictionaries to store tables instead of actually computing the numbers in those tables. In principle, these are the steps you need to take when generating a QR code:
  • Encode the given data as binary.
  • Find the error correction code words and code those in binary.
  • Place the data and error correction code words in the matrix.
  • Add required blocks such as the finders (big squares at the corners).
  • Add the format data to tell what version and mask is used.
  • Apply a data ask to make the code easier to process.

QR codes are pretty handy since it makes it really easy to share data quickly on the fly! You can also set your profile picture to a QR code of something you want to advertise. That's free advertising space on every post you make! ;)

Fun fact: Python already has a module to generate QR codes called pyqrcode. You can download it using the command pip3 install pyqrcode (no guarantees, but that's what worked on my Raspberry Pi).

Here are a few example QR codes generated with my code.
Figure 1: Version 1 QR Code (up to 25 alphanumeric characters) containing the text "HELLO WORLD"
[asy]
int[][] qrdata = {{1,1,1,1,1,1,1,0,1,1,0,0,1,0,1,1,1,1,1,1,1},
{1,0,0,0,0,0,1,0,0,1,0,0,1,0,1,0,0,0,0,0,1},
{1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,1},
{1,0,1,1,1,0,1,0,1,0,0,1,0,0,1,0,1,1,1,0,1},
{1,0,1,1,1,0,1,0,1,1,1,0,0,0,1,0,1,1,1,0,1},
{1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1},
{1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0},
{1,1,1,1,0,0,1,0,1,0,1,0,0,1,0,0,1,1,1,0,0},
{1,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,1,1,1,1,0},
{0,1,1,0,1,0,1,1,1,1,1,0,1,1,0,1,0,0,0,1,1},
{1,1,1,1,0,0,0,0,1,1,0,0,1,0,1,1,0,0,0,1,1},
{0,1,1,0,0,0,1,1,0,1,0,1,0,1,0,1,0,1,1,1,0},
{0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,1,0,0,0,0,0},
{1,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,0,1,0,1},
{1,0,0,0,0,0,1,0,0,0,1,1,1,0,0,1,0,1,0,0,1},
{1,0,1,1,1,0,1,0,0,1,0,1,0,0,1,1,0,0,1,1,1},
{1,0,1,1,1,0,1,0,1,1,1,0,0,1,0,0,0,0,0,1,0},
{1,0,1,1,1,0,1,0,1,1,1,1,0,0,0,1,1,0,0,0,0},
{1,0,0,0,0,0,1,0,1,0,0,1,1,0,1,1,1,0,0,0,0},
{1,1,1,1,1,1,1,0,1,1,0,1,1,1,0,0,1,1,1,1,0},
};
int side = 21;filldraw((-4, 4)--(-4,-(side+4))--(side+4, -(side+4))--(side+4, 4)--cycle, white);
                for (int i = 0; i < side; ++i) {
                    for (int j = 0; j < side; ++j) {
                        if (qrdata[j][i] == 1) {
                            fill((i, -j)--(i+1,-j)--(i+1,-j-1)--(i,-j-1)--cycle, black);
                        }
                    }
                }
[/asy]
Figure 2: Version 2 QR Code (up to 47 alphanumeric characters) containing the url "HTTPS://BIT.LY/SIRCALCSALOTSBLOG"
[asy]
int[][] qrdata = {{1,1,1,1,1,1,1,0,1,0,1,0,1,1,0,1,1,0,1,1,1,1,1,1,1},
{1,0,0,0,0,0,1,0,0,1,1,1,1,0,1,1,1,0,1,0,0,0,0,0,1},
{1,0,1,1,1,0,1,0,1,1,1,0,0,0,1,1,1,0,1,0,1,1,1,0,1},
{1,0,1,1,1,0,1,0,1,1,1,0,1,1,0,1,1,0,1,0,1,1,1,0,1},
{1,0,1,1,1,0,1,0,1,0,0,1,1,0,1,1,0,0,1,0,1,1,1,0,1},
{1,0,0,0,0,0,1,0,0,0,1,1,0,0,1,1,0,0,1,0,0,0,0,0,1},
{1,1,1,1,1,1,1,0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cycle, white);
                for (int i = 0; i < side; ++i) {
                    for (int j = 0; j < side; ++j) {
                        if (qrdata[j][i] == 1) {
                            fill((i, -j)--(i+1,-j)--(i+1,-j-1)--(i,-j-1)--cycle, black);
                        }
                    }
                }
[/asy]
Figure 3: Version 5 QR Code (up to 154 alphanumeric characters) containing the text "IT IS A PERIOD OF CIVIL WAR. REBEL SPACESHIPS STRIKING FROM A HIDDEN BASE HAVE WON THEIR FIRST VICTORY AGAINST THE EVIL GALACTIC EMPIRE."
[asy]
int[][] qrdata = {{1,1,1,1,1,1,1,0,1,0,1,0,1,0,0,0,1,0,1,1,1,0,1,0,1,0,0,1,0,0,1,1,1,1,1,1,1},
{1,0,0,0,0,0,1,0,0,1,1,1,1,0,0,1,0,0,0,0,1,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1},
{1,0,1,1,1,0,1,0,1,1,1,0,0,0,1,0,1,0,1,0,0,0,1,1,0,0,0,1,1,0,1,0,1,1,1,0,1},
{1,0,1,1,1,0,1,0,1,1,1,0,1,0,0,0,0,1,1,1,0,0,1,0,0,0,1,1,0,0,1,0,1,1,1,0,1},
{1,0,1,1,1,0,1,0,1,0,0,1,1,1,0,1,1,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,1,1,0,1},
{1,0,0,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,1,0,1,1,0,1,1,0,1,0,1,0,0,0,0,0,1},
{1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0},
{1,1,1,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1,1,1,1,0,1,0,1,0,0,0,1,0,0,1,1,1,0,0},
{0,1,1,0,1,1,0,0,1,1,1,0,1,0,0,0,1,0,0,1,0,1,1,0,0,0,1,0,1,1,1,0,1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,1,0,0,1,0,1},
};
int side = 37;filldraw((-4, 4)--(-4,-(side+4))--(side+4, -(side+4))--(side+4, 4)--cycle, white);
                for (int i = 0; i < side; ++i) {
                    for (int j = 0; j < side; ++j) {
                        if (qrdata[j][i] == 1) {
                            fill((i, -j)--(i+1,-j)--(i+1,-j-1)--(i,-j-1)--cycle, black);
                        }
                    }
                }
[/asy]
Figure 4: Version 5 QR Code (up to 154 alphanumeric characters) containing the text "ONE LAST EXAMPLE"
[asy]
int[][] qrdata = {{1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1},
{1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,1},
{1,0,1,1,1,0,1,0,1,0,0,1,1,1,1,1,0,0,1,0,1,0,0,1,1,1,1,1,0,0,1,0,1,1,1,0,1},
{1,0,1,1,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,0,0,1,0,1,0,1,1,1,0,1},
{1,0,1,1,1,0,1,0,1,1,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,0,0,1,0,1,1,1,0,1},
{1,0,0,0,0,0,1,0,0,1,0,0,1,0,1,0,0,1,1,1,1,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1},
{1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0},
{1,1,1,1,0,0,1,0,1,0,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,1,1,0,1,1,0,0,1,1,1,0,0},
{0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,1,1,0,1,1,1,1,0,1,1},
{0,0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};
int side = 37;filldraw((-4, 4)--(-4,-(side+4))--(side+4, -(side+4))--(side+4, 4)--cycle, white);
                for (int i = 0; i < side; ++i) {
                    for (int j = 0; j < side; ++j) {
                        if (qrdata[j][i] == 1) {
                            fill((i, -j)--(i+1,-j)--(i+1,-j-1)--(i,-j-1)--cycle, black);
                        }
                    }
                }
[/asy] Let me know if you have any questions about using my QR code generator or generating QR codes in general.

"Drawing" the AoPS Logos with Python Turtle

by SirCalcsALot, Jul 18, 2020, 5:09 AM

Hi! :D

I saw a competition to draw the best AoPS Online Logo with turtle on a private forum. CaptainFlint suggested that instead of drawing the logo, he could take it from the AoPS website. I decided to steal his idea and program this concept myself. I'm not submitting this as part of the competition for two reasons: collaboration was not allowed and all the program does is steal the logo from the website and display it with turtle.

Here is the code! The idea behind the code is as follows:
  1. Navigate to the url of the image and download it as an .svg file.
  2. Convert this .svg file to a .gif file since turtle can only display gif's.
  3. Move the turtle to the correct location and change it's shape to the gif file.
  4. Finally, repeat these steps for the other three logos
Because of the repetitive tasks, this was perfect for using functions, lists, and loops. At the end of the program, all local versions of the image files are deleted from the computer using the os module. I had to install the svglib module to do the conversion from an svg to gif. Since several extra packages are used, this won't even run in IDLE. I did the programming with Spyder Anaconda IDE since it was much easier to install packages. Google is a programmer's best friend, so take advantage of that when trying new projects.

I've attached the resulting turtle drawing to this post. Enjoy! :D
Attachments:

This is a place for me to put interesting programs and problems (maybe some electrical engineering too!). To see Asymptote codes, use the Asymptote tag.

avatar

SirCalcsALot
Shouts
Submit
  • Wait they were your old classmate
    dang
    also hi SCAL

    by the_mathmagician, Apr 9, 2022, 4:59 PM

  • hello old classmate!

    by RedFlame2112, Nov 10, 2021, 12:17 AM

  • this is the best blog ive ever seen on aops. respect

    by Anaxagoras, Oct 4, 2021, 7:08 PM

  • orz orz orz orz

    by cubingsoda, Aug 3, 2021, 5:27 AM

  • I really like this blog for some reason.

    by AndrewC10, Jul 31, 2021, 4:59 AM

  • who, me?

    by Bachsonata3, Jun 19, 2021, 6:06 PM

  • :O I found you

    by leapftstars, Jun 19, 2021, 6:02 PM

  • can I be contrib? sircalcs pro orz orz orz

    by Bachsonata3, Jun 19, 2021, 5:21 PM

  • One of my favorite helpers :D nice bike btw!

    by AlwaysOnce, May 22, 2021, 3:19 AM

  • sircalcsalot is the best :omighty:

    by pith0n, May 20, 2021, 5:25 AM

  • HELLO!!!!!! :D :D

    by cubingsoda, Apr 15, 2021, 8:00 PM

  • Hello everyone! Nice blog!

    by shadow09, Mar 17, 2021, 2:15 PM

  • @below you got the 100th shout :P

    by player01, Feb 2, 2021, 8:39 PM

  • Hi SirCalcsALot! :-D

    by aops-g5-gethsemanea2, Jan 11, 2021, 12:03 PM

  • Thanks! I'll probably return to my original avatar after the holidays are over.

    by SirCalcsALot, Dec 3, 2020, 11:15 PM

113 shouts
Contributors
Tags
About Owner
  • Posts: 4021
  • Joined: Jun 28, 2014
Blog Stats
  • Blog created: Feb 13, 2015
  • Total entries: 43
  • Total visits: 13636
  • Total comments: 238
Search Blog
a