Octave graphic add-on, Octplot



česky

2.2 Tetragon, n-square, circle



Function file: tetragon(m,n,a,b,alpha,beta,fmt)


This function plots a tetragon, which we can set angles of sides "a","b". Definition:
  • 1 tetragon - left down corner in [m,n] and length of sides "a" and "b" and angles of sides "alpha","beta"; all values are scalars
  • n-tetragons - left down corner in [m,n] and length of sides "a" and "b" and angles of sides "alpha","beta"; all values are vectors (expect fmt)

Parameters m,n describe cprners of the tetragon on axes x,y.
Parameters a,b describe length of sides of the tetragon.
Parameters alpha,beta describe angle of slope sides "a","b".
Parameter fmt describe format of the tetragon lines. You can change format of lines (color and style) and format of points.



Example:
tetragon([2,5],[1,5],[5,2],[2,5],[30,60],[10,30]);



download m-file



Function file: nsquare(m,n,n_number,r,fmt)


This function plots a n-square with optional number of sides. Definition:
  • 1 n-square - centre of n-square is in [m,n]; all values are scalarsí
  • N n-squares - centres of n-square is in [m,n]; all values are vectors (expect fmt)

Parameters m,n describe centre of the n-square in axes x,y.
Parameter n_number describe number of sides of the n-square.
Parameter fmt describe format of the n-square lines. You can change format of lines (color and style) and format of points.

Example:
nsquare([-1,2],[2,3],[7,6],[3,4.5],"b^--");





Function file: circle(m,n,r,q,fmt)


This function plots a circle defined by:
  • 1 circle - centre of is in [m,n], radius r; all values are scalars
  • N circles - centres of is in [m,n], radiuses r; all values are vectors (expect fmt)

Parameters m,n describe centre of the circle in axes x,y.
Parameter r describe radius of the circle.
Parameter q is for change compute points on the circle, so quality.
Parameter fmt describe format of circle lines. You can change format of lines (color and style) and format of points.

Example:
circle([5,3],[-2,0],[5,3.5],[25,100]);




download m-file



<<< 2.1 Square, rectangle, triangle 2.3 Ellipse, hyperbola, parabola >>>

© 2008 David Prokop