Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 3rd, 2005, 11:04 PM
Authorized User
 
Join Date: May 2005
Location: , , .
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default Graphics Math Functions

for example f(x)=x^2
or f(x)=sin(x)
where do i start? I know how to draw basic shapes on a form but i have no idea how to draw a function that is not a straight line. Thanks for any future help.


~~~~~~~~~~~~~~~~~~~~~
I'm sorry for having a rude signature Peter. I'm sorry for having a rude signature Peter. I'm sorry for having a rude signature Peter. I'm sorry for having a rude signature Peter. I'm sorry for having a rude signature Peter. I'm sorry for having a rude signature Peter. I'm sorry for having a rude signature Peter. I'm sorry for having a rude signature Peter. I'm sorry for having a rude signature Peter. I'm sorry for having a rude signature Peter.
__________________
~~~~~~~~~~~~~~~~~~~~~
I\'m sorry for having a rude signature Peter. I\'m sorry for having a rude signature Peter. I\'m sorry for having a rude signature Peter. I\'m sorry for having a rude signature Peter. I\'m sorry for having a rude signature Peter. I\'m sorry for having a rude signature Peter. I\'m sorry for having a rude signature Peter. I\'m sorry for having a rude signature Peter. I\'m sorry for having a rude signature Peter. I\'m sorry for having a rude signature Peter.
Reply With Quote
  #2 (permalink)  
Old December 7th, 2005, 04:45 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Over the span of the function, calculate the values incrementally. Armed with the results, draw lines or points representing them shifted incrementally to the right per incrementation, and elevated in the Y according to the value.
Reply With Quote
  #3 (permalink)  
Old January 1st, 2006, 11:06 AM
Registered User
 
Join Date: Jan 2006
Location: Bechar, N/A, Algeria.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

There is what the yur response look like

Public function MyFunc(Byval x as Double) as double
    If Not(x.IsNaN) Then
      Return(Math.sin(x))
    else
      Return(Double.IsNaN)
    endif
end function


Public Sub DrawValue()
   Dim y as Double = 0D
   Dim z as Double = 0D
    Dim g as Graphics = Form1.CreatGraphics()
    For x as Integer=0 To 100
       y=CDbl(Math.PI*x)
       z=MyFunc(y)
       g.DrawLine(Pen.Black, Xx, Yy, y, z)
    Next
end Sub



MTOMY
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Math Functions on dynamic data jroxit Classic ASP Basics 3 January 23rd, 2007 12:07 PM
Getting percentages with math functions tslag XSLT 1 June 22nd, 2006 11:47 AM
Math question dparsons ASP.NET 1.0 and 1.1 Professional 5 June 14th, 2006 02:31 PM
Math functions-Please help! jroxit ASP.NET 2.0 Basics 5 December 28th, 2005 12:21 PM
Why are my math functions not being included? jkeen BOOK Beginning Linux Programming, 3rd Edition 4 October 22nd, 2004 05:29 AM



All times are GMT -4. The time now is 05:47 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.