[not working yet] ☞ This project calculates the number of lattice points inside a circle. Lattice points are points with only integer coordinates. ▼△▼△▼△▼△▼△▼△▼△▼△▼△▼△▼△▼△▼ This was originally done in C++. This is the code: #include <iostream> using namespace std; int main(){ int rmin = [insert number]; int rmax = [insert number]; for(int r = rmin; r <= rmax; r++){ int N = 0; for(int x = -r; x <= r; x++){ for(int y = -r; y <= r; y++){ if (x*x+y*y <= r*r) {N = N+1;}}} cout << "Radius: " << r << " Lattice Points: " << N << endl;} } ▼△▼△▼△▼△▼△▼△▼△▼△▼△▼△▼△▼△▼
Credits ✧・゚: ✿ @Scrathbox for the typing text engine (https://scratch.mit.edu/projects/360343928/) ▼△▼△▼△▼△▼△▼△▼△▼△▼△▼△▼△▼△▼ To be added ✧・゚: ✿ Calculating the number of lattice points for multiple values of n (the C++ code already has this). ❀ Calculating the number of lattice points both inside the circle, on the circle, or both. ▼△▼△▼△▼△▼△▼△▼△▼△▼△▼△▼△▼△▼ Tags (ignore) #math #mathematics #geometry #circle #circles