{"id":21354476,"url":"https://github.com/codeficct/practico-2-graficos","last_synced_at":"2025-07-07T07:36:15.783Z","repository":{"id":125527234,"uuid":"492347387","full_name":"codeficct/practico-2-graficos","owner":"codeficct","description":"✨ Práctico 2 de Gráficos - Lineas y Rectángulos Simétricos","archived":false,"fork":false,"pushed_at":"2022-08-24T03:52:10.000Z","size":1012,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T17:46:53.361Z","etag":null,"topics":["class","graphics","uagrm","visual-basic","windows-forms"],"latest_commit_sha":null,"homepage":"","language":"Visual Basic .NET","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeficct.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-14T23:40:46.000Z","updated_at":"2024-01-06T17:21:26.000Z","dependencies_parsed_at":"2023-08-11T21:50:26.685Z","dependency_job_id":null,"html_url":"https://github.com/codeficct/practico-2-graficos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeficct%2Fpractico-2-graficos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeficct%2Fpractico-2-graficos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeficct%2Fpractico-2-graficos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeficct%2Fpractico-2-graficos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeficct","download_url":"https://codeload.github.com/codeficct/practico-2-graficos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243828203,"owners_count":20354447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["class","graphics","uagrm","visual-basic","windows-forms"],"created_at":"2024-11-22T04:13:31.339Z","updated_at":"2025-03-16T05:22:03.020Z","avatar_url":"https://github.com/codeficct.png","language":"Visual Basic .NET","readme":"# Práctico de Gráficos\n### Lineas y Rectángulos Simétricos\n\n![Practice of visual basic graphics](https://user-images.githubusercontent.com/88288135/186324425-7aec102d-8980-41e2-a756-1a96a3ffffc8.gif)\n\n\nRealizar los gráficos como un proyecto en Visual Basic.\n- Todos los gráficos simétricos toman N Partes\n- Todos los gráficos aleatorios toman N Líneas\n- Se debe realizar un proceso para una parte(mitad) y otro para la segunda parte\n- ✅ Lenguaje de programación: Visual Basic\n- [ver PDF del Práctico de Gráficos](https://drive.google.com/file/d/1gr9bFUKlNZbxdDsgVC3dzoxcPqOcyYKS/view?usp=sharing)\n\n\n## Contenido\n1. [Ejercicio 1](#ejercicio-1)\n2. [Ejercicio 2](#ejercicio-2)\n3. [Ejercicio 3](#ejercicio-3)\n4. [Ejercicio 4](#ejercicio-4)\n5. [Ejercicio 5](#ejercicio-5)\n6. [Ejercicio 6](#ejercicio-6)\n7. [Ejercicio 7](#ejercicio-7)\n8. [Ejercicio 8](#ejercicio-8)\n9. [Ejercicio 9](#ejercicio-9)\n10. [Ejercicio 10](#ejercicio-10)\n\n### Primeros pasos ⚠️\n```vb\nPublic Class Form1\n    ' Crear una variable global de tipo Graphics\n    Dim graphic As Graphics\n    ' Definimos la variable timing para el retardo\n    Dim timing As Integer = 99000000\n    ' Cuando el formulario se abra por primera vez \n    ' asignaremos el PictureBox1.CreateGraphics a\n    ' la variable graphic\n    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load\n        graphic = PictureBox1.CreateGraphics\n    End Sub\n    ' Crearemos un procedimiento o una function que no retorna nada\n    ' para graficar un rectangulo mas conocido como marco.\n    Public Sub Frame()\n        graphic.DrawRectangle(Pens.Gray, 0, 0, PictureBox1.Width - 1, PictureBox1.Height - 1)\n    End Sub\n    ' *******************************************************************\n    ' **  FUNCIONES REUTILIZABLES QUE USAREMOS PARA NO REPETIR CODIGO  **\n    ' estas funciones podras usarlas en cualquier ejercicio del práctico.\n    ' *******************************************************************\n\n    ' Esta function genera un Rectangulo con una linea por la Mitad\n    ' el parametro \"align\" solo podra recibir \"vertical\" y \"horizontal\"\n    Public Sub CreateRectangleWithHalf(ax As Single, bx As Single, ay As Single, by As Single, align As String)\n        Dim half As Single\n        ' Pintamos el rectangulo de color Verde\n        Using pen As New Pen(Color.Green) ' Puedes modificarlo si gustas\n            pen.Width = 2\n            graphic.DrawRectangle(pen, ax, ay, bx - ax, by - ay)\n            Select Case align\n                Case \"vertical\"\n                    half = (ax + bx) / 2\n                    graphic.DrawLine(pen, half, ay, half, by) ' * Vertical\n                Case \"horizontal\"\n                    half = (ay + by) / 2\n                    graphic.DrawLine(pen, ax, half, bx, half) ' * Horizontal\n                Case Else\n            End Select\n        End Using\n    End Sub\n\n    ' Esta funcion genera elementos Graficos (linea, rectangulo y ellipse)\n    ' con colores random\n    ' @parametros:\n    ' x es la posision en el eje X\n    ' y es la posision en el eje Y\n    ' w es el ancho total del grafico (rectangle or ellipse)\n    ' h es el alto total del grafico (rectangle or ellipse)\n    Public Sub GraphicRandomColor(x As Single, y As Single, w As Single, h As Single, gName As String)\n        Dim rng As New Random()\n        Using pen = New Pen(Color.FromArgb(rng.Next(256), rng.Next(156), rng.Next(200)))\n            pen.Width = 2\n            Select Case gName\n                Case \"line\"\n                    ' para las lineas pasaremos x1, y1, x2, y2\n                    graphic.DrawLine(pen, x, y, w, h) ' * x1, y1, x2, y2\n                Case \"rectangle\"\n                    graphic.DrawRectangle(pen, x, y, w, h)\n                Case \"ellipse\"\n                    graphic.DrawEllipse(pen, x, y, w, h)\n                Case Else\n\n            End Select\n        End Using\n    End Sub\n\n    ' DESDE AQUI DESARROLLARAS EL PRACTICO...    \nEnd Class\n```\n\n## Ejercicio 1\n![example-1](https://user-images.githubusercontent.com/88288135/186312380-2f6ddec8-0189-4749-a079-6420da44bec7.png)\n\u003cdetails\u003e\n  \u003csummary\u003eVer codigo\u003c/summary\u003e\n\n```vb\n' * 1. Exercice symmetric graphics\nPublic Sub SymmetricGraphic1(ax As Single, bx As Single, ay As Single, by As Single, n As UInt32, half As Boolean)\n    Dim x1, x2, y1, y2, mx, halfmy, r1, r2, vi1, vi2 As Single\n    Dim index, j As UInt32\n    mx = bx - ax : halfmy = (ay + by) / 2\n    CreateRectangleWithHalf(ax, bx, ay, by, \"horizontal\") ' Horizontal\n    r1 = mx / n : vi1 = ax\n    r2 = (halfmy - ay) / n : x2 = bx\n    ' Condicional para indicar en que mitad pintar las lineas\n    If half Then\n        y1 = halfmy : vi2 = ay\n    Else\n        y1 = by : vi2 = halfmy\n    End If\n    For index = 1 To n\n        x1 = vi1 + (index - 1) * r1\n        y2 = vi2 + (index - 1) * r2\n        GraphicRandomColor(x1, y1, x2, y2, \"line\")\n        For j = 1 To timing\n        Next\n    Next\nEnd Sub\n```\n```vb\n' Llamada de la funcion\nPrivate Sub CualquierEvento_Click(sender As Object, e As EventArgs) Handles CualquierEvento.Click\n    ' Esta llamada pinta el grafico en una mitad del marco\n    SymmetricGraphic1(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, True)\n    ' Esta llamada pinta el grafico en la otra mitad del marco\n    SymmetricGraphic1(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, False)\nEnd Sub\n```\n\n\u003c/details\u003e\n\n## Ejercicio 2\n![example-2](https://user-images.githubusercontent.com/88288135/186312922-076736fa-c550-4ea7-937e-ab2095816f98.png)\n\n\u003cdetails\u003e\n  \u003csummary\u003eVer codigo\u003c/summary\u003e\n\n```vb\n' *  2. Exercice symmetric graphics\nPublic Sub SymmetricGraphic2(ax As Single, bx As Single, ay As Single, by As Single, n As UInt32, half As Boolean)\n    Dim x1, x2, y1, y2, my, halfmx, r, vi As Single\n    Dim index, j As UInt32\n    my = by - ay : halfmx = (ax + bx) / 2\n    CreateRectangleWithHalf(ax, bx, ay, by, \"vertical\") 'Vertical\n    r = my / n : vi = ay\n    y1 = (ay + by) / 2\n    x2 = halfmx\n    If half Then\n        x1 = ax\n    Else\n        x1 = bx\n    End If\n    For index = 1 To n + 1\n        y2 = vi + (index - 1) * r\n        GraphicRandomColor(x1, y1, x2, y2, \"line\")\n        For j = 1 To timing\n        Next\n    Next\nEnd Sub\n```\n```vb\n' Llamada de la funcion\nPrivate Sub CualquierEvento_Click(sender As Object, e As EventArgs) Handles CualquierEvento.Click\n    ' Esta llamada pinta el grafico en una mitad del marco\n    SymmetricGraphic2(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, True)\n    ' Esta llamada pinta el grafico en la otra mitad del marco\n    SymmetricGraphic2(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, False)\nEnd Sub\n```\n\n\u003c/details\u003e\n\n## Ejercicio 3\n![example-3](https://user-images.githubusercontent.com/88288135/186314735-1b11c1b1-7d3b-4334-b8f1-5bc46076cd92.png)\n\n\u003cdetails\u003e\n  \u003csummary\u003eVer codigo\u003c/summary\u003e\n\n```vb\n' *  3. Exercice symmetric graphics\nPublic Sub SymmetricGraphic3(ax As Single, bx As Single, ay As Single, by As Single, n As UInt32, half As Boolean)\n    Dim x1, x2, y1, y2, my, halfmx, r, vi As Single\n    Dim index, j As UInt32\n    my = by - ay : halfmx = (ax + bx) / 2\n    CreateRectangleWithHalf(ax, bx, ay, by, \"vertical\") 'Vertical\n    r = my / n : vi = ay\n    x2 = halfmx : y2 = (ay + by) / 2\n    If half Then\n        x1 = ax\n    Else\n        x1 = bx\n    End If\n    For index = 1 To n + 1\n        y1 = vi + (index - 1) * r\n        GraphicRandomColor(x1, y1, x2, y2, \"line\")\n        For j = 1 To timing\n        Next\n    Next\nEnd Sub\n```\n```vb\n' Llamada de la funcion\nPrivate Sub CualquierEvento_Click(sender As Object, e As EventArgs) Handles CualquierEvento.Click\n    ' Esta llamada pinta el grafico en una mitad del marco\n    SymmetricGraphic3(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, True)\n    ' Esta llamada pinta el grafico en la otra mitad del marco\n    SymmetricGraphic3(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, False)\nEnd Sub\n```\n\n\u003c/details\u003e\n\n## Ejercicio 4\n![example-4](https://user-images.githubusercontent.com/88288135/186314808-efde460d-cc76-4acf-bdee-ac5b73ff6087.png)\n\n\u003cdetails\u003e\n  \u003csummary\u003eVer codigo\u003c/summary\u003e\n\n```vb\n' *  4. Exercice symmetric graphics\nPublic Sub SymmetricGraphic4(ax As Single, bx As Single, ay As Single, by As Single, n As UInt32, half As Boolean)\n    Dim x1, x2, y1, y2, my, halfmx, r, vi As Single\n    Dim index, j As UInt32\n    my = by - ay : halfmx = (ax + bx) / 2\n    CreateRectangleWithHalf(ax, bx, ay, by, \"vertical\") 'Vertical\n    r = my / n : vi = ay : x2 = halfmx\n    If half Then\n        x1 = ax : y1 = by\n    Else\n        x1 = bx : y1 = ay\n    End If\n    For index = 1 To n\n        y2 = vi + (index - 1) * r\n        GraphicRandomColor(x1, y1, x2, y2, \"line\")\n        For j = 1 To timing\n        Next\n    Next\nEnd Sub\n```\n```vb\n' Llamada de la funcion\nPrivate Sub CualquierEvento_Click(sender As Object, e As EventArgs) Handles CualquierEvento.Click\n    ' Esta llamada pinta el grafico en una mitad del marco\n    SymmetricGraphic4(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, True)\n    ' Esta llamada pinta el grafico en la otra mitad del marco\n    SymmetricGraphic4(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, False)\nEnd Sub\n```\n\n\u003c/details\u003e\n\n## Ejercicio 5\n![example-5](https://user-images.githubusercontent.com/88288135/186314857-56899c50-65b3-4882-94db-0bd47f706a43.png)\n\n\u003cdetails\u003e\n  \u003csummary\u003eVer codigo\u003c/summary\u003e\n\n```vb\n' *  5. Exercice symmetric graphics\nPublic Sub SymmetricGraphic5(ax As Single, bx As Single, ay As Single, by As Single, n As UInt32, half As Boolean)\n    Dim x1, x2, y1, y2, my, mx, halfmx, r1, r2, vi1, vi2 As Single\n    Dim index, j As UInt32\n    mx = bx - ax : my = by - ay : halfmx = (ax + bx) / 2\n    CreateRectangleWithHalf(ax, bx, ay, by, \"vertical\") 'Vertical\n    r1 = my / n : vi1 = ay : x1 = halfmx\n    r2 = (mx / 2) / n : y2 = by\n    If half Then\n        vi2 = halfmx + r2\n    Else\n        vi2 = halfmx - r2\n    End If\n    For index = 1 To n\n        y1 = vi1 + (index - 1) * r1\n        If half Then\n            x2 = vi2 + (index - 1) * r2\n            GraphicRandomColor(x1, y1, x2, y2, \"line\")\n        Else\n            x2 = vi2 - (index - 1) * r2\n            GraphicRandomColor(x1, y1, x2, y2, \"line\")\n        End If\n        For j = 1 To timing\n        Next\n    Next\nEnd Sub\n```\n```vb\n' Llamada de la funcion\nPrivate Sub CualquierEvento_Click(sender As Object, e As EventArgs) Handles CualquierEvento.Click\n    ' Esta llamada pinta el grafico en una mitad del marco\n    SymmetricGraphic5(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, True)\n    ' Esta llamada pinta el grafico en la otra mitad del marco\n    SymmetricGraphic5(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, False)\nEnd Sub\n```\n\n\u003c/details\u003e\n\n## Ejercicio 6\n![example-6](https://user-images.githubusercontent.com/88288135/186314955-99072b92-704c-45a2-8fc8-22e8f77cc8d2.png)\n\n\u003cdetails\u003e\n  \u003csummary\u003eVer codigo\u003c/summary\u003e\n\n```vb\n' * 6. Exercise random graphics\nPublic Sub RandomLines6(ax As Single, bx As Single, ay As Single, by As Single, n As UInt32, half As Boolean)\n    Dim x1, x2, y1, y2, my, halfmx, halfmy As Single\n    Dim index, j As UInt32\n    my = by - ay : halfmx = (ax + bx) / 2 : halfmy = (ay + by) / 2\n    CreateRectangleWithHalf(ax, bx, ay, by, \"vertical\") 'Vertical\n    x1 = halfmx : y1 = halfmy\n    For index = 1 To n\n        y2 = ay + Rnd() * my\n        If half Then\n            x2 = halfmx + Rnd() * (bx - halfmx)\n        Else\n            x2 = ax + Rnd() * (halfmx - ax)\n        End If\n        GraphicRandomColor(x1, y1, x2, y2, \"line\")\n        For j = 1 To timing\n        Next\n    Next\nEnd Sub\n```\n```vb\n' Llamada de la funcion\nPrivate Sub CualquierEvento_Click(sender As Object, e As EventArgs) Handles CualquierEvento.Click\n    ' Esta llamada pinta el grafico en una mitad del marco\n    RandomLines6(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, True)\n    ' Esta llamada pinta el grafico en la otra mitad del marco\n    RandomLines6(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, False)    \nEnd Sub\n```\n\n\u003c/details\u003e\n\n## Ejercicio 7\n![example-7](https://user-images.githubusercontent.com/88288135/186315027-312ac77f-b65f-491e-8c36-5af9a6b6b16b.png)\n\n\u003cdetails\u003e\n  \u003csummary\u003eVer codigo\u003c/summary\u003e\n\n```vb\n' * 7. Exercise random graphics\nPublic Sub RandomLines7(ax As Single, bx As Single, ay As Single, by As Single, n As UInt32, half As Boolean)\n    Dim x1, x2, y1, y2, my, halfmx As Single\n    Dim index, j As UInt32\n    my = by - ay : halfmx = (ax + bx) / 2\n    CreateRectangleWithHalf(ax, bx, ay, by, \"vertical\") 'Vertical\n    y1 = ay + (my / 2)\n    If half Then\n        x1 = (ax + halfmx) / 2\n    Else\n        x1 = halfmx + ((bx - ax) / 2) / 2\n    End If\n    For index = 1 To n\n        y2 = ay + Rnd() * my\n        If half Then\n            x2 = ax + Rnd() * (halfmx - ax)\n        Else\n            x2 = halfmx + Rnd() * (bx - halfmx)\n        End If\n        GraphicRandomColor(x1, y1, x2, y2, \"line\")\n        For j = 1 To 66000000\n        Next\n    Next\nEnd Sub\n```\n```vb\n' Llamada de la funcion\nPrivate Sub CualquierEvento_Click(sender As Object, e As EventArgs) Handles CualquierEvento.Click\n    ' Esta llamada pinta el grafico en una mitad del marco\n    RandomLines7(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, True)\n    ' Esta llamada pinta el grafico en la otra mitad del marco\n    RandomLines7(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, False)\nEnd Sub\n```\n\n\u003c/details\u003e\n\n## Ejercicio 8\n![example-8](https://user-images.githubusercontent.com/88288135/186315157-745feb3b-5ee9-4662-8ee0-446a956c7562.png)\n\n\u003cdetails\u003e\n  \u003csummary\u003eVer codigo\u003c/summary\u003e\n\n```vb\n' * 8. Exercice random graphics\nPublic Sub RandomLines8(ax As Single, bx As Single, ay As Single, by As Single, n As UInt32, half As Boolean)\n    Dim x1, x2, y1, y2, my, halfmx As Single\n    Dim index, j As UInt32\n    CreateRectangleWithHalf(ax, bx, ay, by, \"vertical\") 'Vertical\n    my = by - ay : halfmx = (ax + bx) / 2 : x1 = halfmx\n    For index = 1 To n\n        y1 = ay + Rnd() * my\n        If half Then\n            x2 = halfmx + Rnd() * (bx - halfmx)\n        Else\n            x2 = ax + Rnd() * (halfmx - ax)\n        End If\n        y2 = y1\n        GraphicRandomColor(x1, y1, x2, y2, \"line\")\n        For j = 1 To timing\n        Next\n    Next\nEnd Sub\n```\n```vb\n' Llamada de la funcion\nPrivate Sub CualquierEvento_Click(sender As Object, e As EventArgs) Handles CualquierEvento.Click\n    ' Esta llamada pinta el grafico en una mitad del marco\n    RandomLines8(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, True)\n    ' Esta llamada pinta el grafico en la otra mitad del marco\n    RandomLines8(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, False)\n    \nEnd Sub\n```\n\n\u003c/details\u003e\n\n## Ejercicio 9\n![example-9](https://user-images.githubusercontent.com/88288135/186315223-fc5e3652-7b95-45c5-8086-0b3a919e67d3.png)\n\n\u003cdetails\u003e\n  \u003csummary\u003eVer codigo\u003c/summary\u003e\n\n```vb\n' * 9 Exercice random graphics\nPublic Sub RandomLines9(ax As Single, bx As Single, ay As Single, by As Single, n As UInt32, half As Boolean)\n    Dim x1, x2, y1, y2, halfmx As Single\n    Dim aux As Boolean = True\n    Dim index, j As UInt32\n    CreateRectangleWithHalf(ax, bx, ay, by, \"vertical\") 'Vertical\n    halfmx = (bx + ax) / 2 : y1 = ay : y2 = by\n    If half Then\n        x1 = ax + Rnd() * (halfmx - ax)\n    Else\n        x1 = halfmx + Rnd() * (bx - halfmx)\n    End If\n    For index = 1 To n\n        If half Then\n            x2 = ax + Rnd() * (halfmx - ax)\n        Else\n            x2 = halfmx + Rnd() * (bx - halfmx)\n        End If\n        If aux Then\n            GraphicRandomColor(x1, y1, x2, y2, \"line\")\n        Else\n            GraphicRandomColor(x1, y2, x2, y1, \"line\")\n        End If\n        aux = Not aux\n        x1 = x2\n        For j = 1 To timing\n        Next\n    Next\nEnd Sub\n```\n```vb\n' Llamada de la funcion\nPrivate Sub CualquierEvento_Click(sender As Object, e As EventArgs) Handles CualquierEvento.Click\n    ' Esta llamada pinta el grafico en una mitad del marco\n    RandomLines9(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, True)\n    ' Esta llamada pinta el grafico en la otra mitad del marco\n    RandomLines9(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, False)\nEnd Sub\n```\n\n\u003c/details\u003e\n\n## Ejercicio 10\n![example-10](https://user-images.githubusercontent.com/88288135/186315285-1c997e14-b183-411b-80e8-4f5b68a5db80.png)\n\n\u003cdetails\u003e\n  \u003csummary\u003eVer codigo\u003c/summary\u003e\n\n```vb\n' * 10 Exercice random graphics\nPublic Sub RandomLines10(ax As Single, bx As Single, ay As Single, by As Single, n As UInt32, half As Boolean)\n    Dim x1, x2, y1, y2, my, halfmx As Single\n    Dim index, j As UInt32\n    my = by - ay : halfmx = (ax + bx) / 2\n    CreateRectangleWithHalf(ax, bx, ay, by, \"vertical\") 'Vertical\n    If half Then\n        x1 = ax + Rnd() * (halfmx - ax) : y1 = ay + Rnd() * my\n    Else\n        x1 = halfmx + Rnd() * (bx - halfmx) : y1 = ay + Rnd() * my\n    End If\n    For index = 1 To n\n        If half Then\n            x2 = ax + Rnd() * (halfmx - ax) : y2 = ay + Rnd() * my\n        Else\n            x2 = halfmx + Rnd() * (bx - halfmx) : y2 = ay + Rnd() * my\n        End If\n        GraphicRandomColor(x1, y1, x2, y2, \"line\")\n        x1 = x2 : y1 = y2\n        For j = 1 To timing\n        Next\n    Next\nEnd Sub\n```\n```vb\n' Llamada de la funcion\nPrivate Sub CualquierEvento_Click(sender As Object, e As EventArgs) Handles CualquierEvento.Click\n    ' Esta llamada pinta el grafico en una mitad del marco\n    RandomLines10(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, True)\n    ' Esta llamada pinta el grafico en la otra mitad del marco\n    RandomLines10(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, False)\nEnd Sub\n```\n\n\u003c/details\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeficct%2Fpractico-2-graficos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeficct%2Fpractico-2-graficos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeficct%2Fpractico-2-graficos/lists"}