diff --git a/practical_work/tp_vec2/main.c b/practical_work/tp_vec2/main.c
index ac2797489c4d93e69a0ab6c4e72149db563f4b3f..7bee38ff29c1344a5aba2f4b50b748479299e019 100644
--- a/practical_work/tp_vec2/main.c
+++ b/practical_work/tp_vec2/main.c
@@ -7,34 +7,30 @@
 #define SCREEN_WIDTH 1280
 #define SCREEN_HEIGHT 720
 
-double rand_dbl()
-{
-    return ((double)rand()) / RAND_MAX;
+double rand_dbl() {
+    return 2.0 * ((double)rand()) / RAND_MAX - 0.5;
 }
 
-int main()
-{
+int main() {
     srand(time(NULL));
     struct gfx_context_t *ctxt =
         gfx_create("Vec2 demo", SCREEN_WIDTH, SCREEN_HEIGHT);
-    if (!ctxt)
-    {
+    if (!ctxt) {
         fprintf(stderr, "Graphics initialization failed!\n");
         return EXIT_FAILURE;
     }
 
-    vec2 center = vec2_create(0.5, 0.5);
+    vec2 center   = vec2_create(0.0, 0.0);
     double radius = 0.5;
-    for (int i = 0; i < 250000; i++)
-    {
+    for (int i = 0; i < 250000; i++) {
 
         vec2 r = vec2_create(rand_dbl(), rand_dbl());
 
-        //Draw pixel if in circle
-        if (vec2_norm(vec2_sub(r, center)) < radius)
-        {
-            coordinates pixel = vec2_to_coordinates(r, SCREEN_WIDTH, SCREEN_HEIGHT);
-            //Random color (not black)
+        // Draw pixel if in circle
+        if (vec2_norm(vec2_sub(r, center)) < radius) {
+            coordinates pixel =
+                vec2_to_coordinates(r, SCREEN_WIDTH, SCREEN_HEIGHT);
+            // Random color (not black)
             uint32_t color = rand() % 0xFFFFFF;
 
             gfx_putpixel(ctxt, pixel.column, pixel.row, color);
@@ -42,13 +38,11 @@ int main()
     }
 
     gfx_present(ctxt);
-    while (true)
-    {
-        if (gfx_keypressed() == SDLK_ESCAPE)
-        {
+    while (true) {
+        if (gfx_keypressed() == SDLK_ESCAPE) {
             break;
         }
     }
     gfx_destroy(ctxt);
     return EXIT_SUCCESS;
-}
\ No newline at end of file
+}