Skip to content

Commit 2a91238

Browse files
fix comment and logic lmao
gaje ck
1 parent 6ae3581 commit 2a91238

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

image/PNG/src/prime-art.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ int main(int argc, const char* argv[]) {
8282
*
8383
* ketika i = s * s gw mau r = halfdiagonal = sqrt(2)/2 * s
8484
* sehingga r = dR * s * s = sqrt(2)/2 * s
85-
* dR * s = sqrt(2)/2 * s
86-
* dR = sqrt(2)/2
85+
* dR * s = sqrt(2)/2
86+
* dR = sqrt(2)/2/s
8787
*/
8888

8989
/* Solve dTheta
@@ -95,7 +95,7 @@ int main(int argc, const char* argv[]) {
9595
* dTheta = 2/sqrt(2) * sqrt(i)
9696
*/
9797

98-
float dR = 0.5 * std::sqrt(2.0f);
98+
float dR = 0.5f * 1/(float)(WIDTH > HEIGHT? WIDTH :HEIGHT) * std::sqrt(2.0f);
9999
const uint64_t cx = WIDTH / 2;
100100
const uint64_t cy = HEIGHT / 2;
101101

0 commit comments

Comments
 (0)