1 minute Arithmetic Analysis  Geometry Statistics Menus, icons,... 
Mathematical Objects Linear algebra Functions 2D Graphics Combinatorics
WIRIS ++ Equations and systems of equations  Progressions 3D Graphics  Units of measurement
3D Graphics  

wiris provides procedures for graphical display in three dimensions. The main application of these procedures is to display geometrical figures and functions.

The graphical display is produced on a Plotter" using the command plot3d. To add text to the drawing, use the command write3d.

You can also use the command geometry_status to learn how to simplify this command.

>>fast   
 Draw command  draw an object Draw a function
drawing an equation options plot3d
 Commands for writing text  write3d options write3d
 Plotter  options plotter3d  
 Interactive geometry  


 Draw command


draw an object: plot3d(d:Plotable3d)

This function is generally used to plot an object d on a "drawing board". Some objects that can be drawn include: Point, Line, Plane3d, Segment, Triangle, Polygonal, Polyhedra3d, Surface, Curve3d and Text_box. If the argument is a List, then all its elements are drawn.

It is worth mentioning the case where parameter d is an identifier (variable). If its value is a drawable object then it is drawn, otherwise no action is taken and a warning is returned. Later, if the value of d changes then the drawing is updated to show the new object. You could say that the drawing board remembers the elements that are drawn on it and redraws them if their value changes.

In the example below this behavior can be confirmed. If P is defined as point (3,5,0) and it is drawn (first block), it appears drawn as point (3,5,0) on the drawing board. If, then, P takes as value the point (2,-1,0), this is the point that appears on the drawing board. Note that this happens without having to use the command plot3d with point P.



Draw a function : command plot3d

To draw both curves and surfaces, we use the command plot3d. In most cases, it is sufficient to indicate the expression of the function that we wish to draw and the system will take care of selecting whether it is a curve or a surface, its path and what variables play the part of x, y or z.

Let’s look at a few examples of surfaces.

We can also specify the variables and the path.





Parametric curves 

To draw parametric curves we will always have to indicate the variable that acts as a parameter and its path.





Parametric surfaces  

We can draw parametric surfaces by specifying the two variables on which the surface depends and their respective paths.



drawing an equation: plot3d(eq:Equation)

The command plot3d also accepts an equation as an argument. This command produces a graph of the mathematical object associated with this equation.

The equations accepted by the command are those corresponding to objects of type Plane3d.



options plot3d: Optionally, the last argument to the plot3d command can be a List of options.

Options give the user control over the appearance of the figure (colour, thickness, etc.). The functionality or quality of some options depends on the version of Java™ (JVM) installed on your computer. If you have Java™ version 1.3 (Java 2) or later, then in the second example you can see lines of different width. Download the latest version of Java.

Enter the option values separated by commas in the following format 'option_name=option_value'. Example: color=color=green.

The main options for the plot3d command are
color

Here, enter the colour that should be used for drawing.

Possible values list of three integers between 0 and 255 in '{r,g,b}' form, where r,g,b corespond to the amount of red, green and blue, which define the colour. For simplicity, some colours have been defined: black, white, red, green, blue, cyan, magenta, yellow, brown, orange, pink, grey, dark_grey, light_grey and the complete list of HTML colours.

Default value black



border

This defines whether the border of closed figures is painted.

Possible values true and false.

Default value true



fill

In the case of a closed figure, the command determines whether the interior is filled.

Possible values true, false and "automatic".

Default value "automatic"



fill_color

If working with a closed figure, and if the value defined for fill is true, this command indicates the colour that should be used to paint the inside of the figures.

Possible values : A Color and "automatic"; if the second option is chosen, the inside of the figure is filled using the colour given by the colour option color

Default value "automatic"



visible

This command determines whether the element is visible or not.

Possible values true and false.

Default value true



transparency

This command determines the element's degree of transparency. Choosing 0 sets transparency to totally opaque. Choosing 1 sets transparency to totally transparent.

Possible values : any Real number between 0 and 1.

Default value : 0.3



mobile

If the object to draw has not been defined as static, the image can move, or not move, in space.

Possible values true and false.

Default value true



wired

This option sets whether the image should be shown wire-framed or not.

Possible values true, false and "automatic".

Default value "automatic"



point_size

This sets the size of points drawn on the drawing board.

Possible values : any positive Real number.

Default value : 5



line_width

This command is used to set the thickness of lines, segments or functions drawn on the drawing board.

Possible values : any positive Real number.

Default value : 1



evaluate

This command defines whether the element should be evaluated when drawing or not.

Possible values true and false.

Default value false



show_label

This command defines whether or not a label is displayed for the figure.

Possible values true and false.

Default value false



label

This defines the label that should be displayed next to the figure.

Possible values : any object and "automatic". If we choose the second option, the label will be the name of the figure.

Default value "automatic"



label_font

This sets the type of font that should be used to write the labels on the drawing board.

Possible values : any object of type Font.

Default value : {bold=false,italic=false,name="SansSerif",size=12}



name

If the command plot3d does not know the name of the object to be drawn, enter it. This only has an effect when working with a single element and not with a list.

Possible values : any object of type String.

Default value null



seed_name

If the command plot3ddoes not know the name of the object to be drawn, the name of the figure is the value of this option concatenated with a number.

Possible values : any object of type String.

Default value null





 Commands for writing text


write3d: write3d(d,P:Point)

This function allow us to write d at point P. Usually d will be of type String although it can be any object. In general, you can think of the command write3d as a quick way of drawing objects of type Text_box.



options write3d: Optionally, the last argument to the write3d command can be a List of options.

Options that can be used with the command write3d include the text_box commands such as plot(They can be viewed here) since write3d(t,d,P,O) is the same as plot(t,text_box(d,P,O),O), where t is a Plotter3d, O is a List of options and d and P are as described in the previous paragraph. To learn more about the options for this command, see the relevant section in the chapter 2D Graphics.



 Plotter

The commands plot3d or write3d can optionally accept, as the first argument, the drawing board where the graphic should be displayed. If the first argument is not a drawing board, wiris provides one with predefined features.

Each set of calculations has a default drawing board. In practice, you can have as many as you wish. The command used to create a drawing board is plotter3d() or plotter3d(P,x,y,z); the latter creates a drawing board centred on point P, of width x, height y and depth z.

Once a drawing board has been created its attributes can be modified using the function attributes3d. In the example below we create a drawing board where, unlike in the default case, neither the axes nor the cube are displayed:

The drawing board icons ( , , , , etc.) are described in the section Menus,icons....



options plotter3d: The main options for the plotter3d command are
center

Sets the centre point of the drawing board.

Possible values : any Point.

Default value point(0,0,0)



height

Sets the height of the drawing board.

Possible values : any positive Real number.

Default value : 21



width

Sets the width of the drawing board.

Possible values : any positive Real number.

Default value : 21



depth

Sets the depth of the drawing board.

Possible values : any positive Real number.

Default value : 21



background_color

Sets the background colour of the drawing board.

Possible values : any Color, in {r,g,b} format, or by name if it has been defined.

Default value : {255,255,240} (cream)



information

This defines the information that should be displayed when the mouse is scrolled over a figure. This information can be changed, once the drawing is on the screen, using the icons , or on the drawing board toolbar.

More information on label or show_label.

Possible values "none", "name", "definition" and "value".

Default value "name"



visible

This defines whether the drawing board is visible or not.

Possible values true and false

Default value true



transform_matrix

This command indicates the position of the display cube within the drawing window. Every time the cube is moved, we can find the new position using the icon on the drawing board toolbar:

Possible values : any Matrix of Real numbers 3x3.

Default value -





· Window attributes



window_height

Sets the height of the drawing window, in pixels.

Possible values : any positive Integer.

Default value : 450



window_width

Sets the width of the drawing window, in pixels.

Possible values : any positive Integer.

Default value : 450





· Coordinate axis attributes



show_axis

Determines whether or not the coordinate axes appear in the drawing.

Possible values true and false.

Default value true



axis_color

If the value for show_axis is true, this command indicates the colour of the axes.

Possible values : any Color, in {r,g,b} format, or by name if it has been defined.

Default value : {150,150,255} (light blue)





· Cube attributes



show_cube

Determines whether or not a cube appears in the drawing. Points can be moved freely around on the drawing board.

Possible values true and false.

Default value true



cube_color

Sets the colour of the cube.

Possible values : any Color, in {r,g,b} format, or by name if it has been defined.

Default value : {150,150,255} (light blue)





 Interactive geometry

Interactive geometry acts the same way in space as it would do in the plane. See Interactive geometry in the plane.

mathsformore.com powered by WIRIS

©2003 maths for more sl. All rights reserved. Legal notice