How to build a graph of functions in Delphi

x=(1+cos(t))*a*cos(t), y=(1+cos(t))*a*sin(t), a>0, 0<=t<360 

?

  • What is not clear to you? What exactly does not work? - toxicdream

2 answers 2

  1. Ask a
  2. In the cycle from 0 to 360, count x and y
  3. For example, on TImage transfer the image (draw on the points from paragraph 2), the main thing is to calculate and scale the graph correctly. Given that the coordinates on a TImage start at the top left corner.

If necessary, change a and repeat the procedure. It's simple.

    Do not use TImage for plotting. Delphi has a TChart component specifically designed for this purpose.

    • one
      What kind of "catastrophe" can happen from this? - insolor Nov.
    • Of course, no "catastrophe" will happen, dear @insolor. Simply, it is necessary to apply the capabilities of the ISR and hammer the nails not with a crowbar or log, but with a hammer specially designed for this operation. Moreover, you can draw directly on the form, without even applying a TImage, which has no advantage in this sense over the form; TChart has huge advantages. - BuilderC
    • The fact that there is a component does not mean that it should be used for educational purposes. TImage has an awesome advantage over the form if you need to place a few more controls on it. Not to mention that inflating holivar due to the component given as an example is our way! Words to search in my answer: set initial values, cycle, by points. And yet it is not clear why you didn’t please TImage, maybe I don’t know something? - Dex
    • @BuilderC, and if the goal of the vehicle is to learn how to work with drawing in Delphi? - Nofate
    • @Dex. No holy war no one with you. There are also no complaints about the words to be searched. Everything that I wanted to say, I said and consider the topic closed. - BuilderC