0% found this document useful (0 votes)
32 views1 page

Public Class Dim As Single Me Dim As Single Me Dim As: Form1 Graphics

This code defines variables to store the width, height, and center point of a form. It creates a graphics object and draws the x and y axes at the center point. It then uses a for loop to calculate x and y values for a logarithmic function, shifts the points to be relative to the center, and draws the curve on the form between each pair of points.

Uploaded by

tatimayi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views1 page

Public Class Dim As Single Me Dim As Single Me Dim As: Form1 Graphics

This code defines variables to store the width, height, and center point of a form. It creates a graphics object and draws the x and y axes at the center point. It then uses a for loop to calculate x and y values for a logarithmic function, shifts the points to be relative to the center, and draws the curve on the form between each pair of points.

Uploaded by

tatimayi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Public Class Form1

Dim x0 As Single = Me.Width / 2


Dim y0 As Single = Me.Height / 2
Dim l As Graphics

Private Sub Btngraficar_Click(sender As Object, e As EventArgs) Handles Btngraficar.Click


graficar()
End Sub
Private Sub graficar()
l = Me.CreateGraphics()
l.DrawLine(Pens.DarkBlue, 0, y0, Me.Width, y0)
l.DrawLine(Pens.DarkBlue, x0, 0, x0, Me.Height)
Dim xi, yi, xf, yf As Single
Dim i As Single
For i = 0.01 To Me.Width / 20 Step 0.05
xi = 20 * i
yi = 20 * Math.Log(xi)
xf = 20 * (i + 0.1)
yf = 20 * Math.Log(xf)
xi += x0
yi = y0 - yi
xf += x0
yf = y0 - yf
l.DrawLine(Pens.Red, xi, yi, xf, yf)
Next
End Sub
End Class

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy