0

I'm having a problem with the tkinter canvas item, I don't know how to create endless lines essentially! I've searched around quite a bit, but I just got the Tip to drive it veeeeeeeeeeeeeeeery long, much more than I would need. Since I'm writing a program to create tangents on mathematical courbes, this don't really helps me out.

Thank you very much!

Edit:

My code in structure:

1) get courbe/ term of courbe
2) calculate coordinates of 2 points on tangential line
3) calculate two points on the tangential
4) create endless line going through the 2 points

Question: How to do 4)

h_e_u_r_e_k_a
  • 115
  • 2
  • 2
  • 21
  • 3
    *veeeeeeeeeeeeeeeery long*: may be in maths, but in computer science we are realistic: the line can not exceed the length of the computer's screen. So just give the max X and max Y coordinates to the 2 points used to draw the line (meaning the line will stretch from one edge to the other of your canvas) – Billal Begueradj Mar 15 '16 at 13:12
  • The problem is that the canvas can have different sizes on different screens, In my script there are 32 possibilitys for the size of the canvas. So is there a possibility or isn't there – h_e_u_r_e_k_a Mar 15 '16 at 13:18
  • The number of the screens you have does not matter because you can [get the dimensions of anyone of them](http://stackoverflow.com/questions/3950687/how-to-find-out-the-current-widget-size-in-tkinter) – Billal Begueradj Mar 15 '16 at 13:22
  • Ok so I will just do it like in my question, the tip i mentionned?? – h_e_u_r_e_k_a Mar 15 '16 at 13:23
  • You are a mathematician, so I am sure you know how to design a simple algorithm for calculating tangents. Do it and implement it. If you get difficulties with your code, we can help you. – Billal Begueradj Mar 15 '16 at 13:26
  • Ok thanks for your time – h_e_u_r_e_k_a Mar 15 '16 at 13:28

0 Answers0