drawing the corners for the inner parallelogram(solved)

asked 2018-11-07 14:18:34 -0600

neory gravatar image

updated 2018-11-08 04:47:21 -0600

Hello,

i have the following plot, how do i draw the corners of the inner parallelogram in it.

If i did something overcomplicated just improve my code ( i'm a beginner).

g = Graphics()
g += text('g1', (10,4.5))
g += plot(2/5*x + 1,(x,-4,10)) #g1

#gradient triangle
g += line([(0,1), (5,1)], rgbcolor=('#00c736'))
g += text('kw = 5', (2.5,0.5), rgbcolor=('#00c736'))
g += line([(5,1), (5,3)],rgbcolor=('#f6a200'))
g += text('ks = 2', (5.5,2), rgbcolor=('#f6a200'))

g += text('g2', (10,1.5))
g += plot(2/5*x - 2,(x,-4, 10)) #g2

g += text('h1', (10,-1.5))
g += plot(-1/2*x+1,(x,-4, 10)) #h1
g += text('h2', (10,-4.5))
g += plot(-1/2*x+4,(x,-4, 10)) #h2
#corners 
g += arc((0.5,1), 1, sector=(pi*0,-pi/4+0.1))
g += arc((0.5,1), 1, sector=(pi*0,pi/4-0.2))
g.show()

can't upload a picture sorry insufficient karma :(.

and how do i change the steps at the x and y -axis to 1.

thanks in advance !

edit retag flag offensive close merge delete

Comments

I'm having trouble understanding the question. What is a angle circle? From your code, I think you might mean arc. Your commented line is drawing the arc for an ellipse. The documentation is here and at the bottom of the page indicates you would want something like g+=arc((0,0), 1, sector=(pi/4,3*pi/4)) but I'm not sure where you want it to start and stop. What does "and add the alpha character into it" mean?

dazedANDconfused gravatar imagedazedANDconfused ( 2018-11-07 20:06:15 -0600 )edit

g+=arc((0,0), 1, sector=(pi/4,3*pi/4)) looks right, it should be placed at the points p1(1|1) to the point p2(1|1.5) with a 90° rotation in the right direction.

Thanks I can work out my solution now the only question that remains is how can I add the angle designations to it?

sry for begin unclear, i don't know how the German word "Winkel" is called in English. I mean the corners inside the parallelogram, i need just a small section of the circle and how do I add the Greek letter small alpha into it.

neory gravatar imageneory ( 2018-11-07 23:33:17 -0600 )edit