(/5)

Hire Me
(5/5)

Hire Me
(5/5)

Hire Me
(5/5)

Hire Me
(5/5)

# Adjustment of the max and min values of the Y-Axis when you plot the tan curve

INSTRUCTIONS TO CANDIDATES

Adjustment of the max and min values of the Y-Axis when you plot the tan curve:

For highest credit:  You generate the y values for the tangent.  Search all the values to select the minimum and maximum.  You put the minimum value to the bottom and maximum to the top of the Y axis.  When you generate the tangent values you don’t know what will be the maximum or minimum.  It depends which angle value you will come up when you divide the x axis to 400 or 800 values to make the plot.  So, the ideal is to find them.

Compromise if you can’t make the above approach work:  You may fix the max. and min. of the Y Axis with two values such as 100 to -100 or 10 to -10.  You can find the one which you like by trial and error.  When you make the tangent plot you may change the Y Axis.

LIST OF THE EXAMPLE PROGRAM

# Graphics Program

from tkinter import *  #  We read the graphic library

import tkinter as tk

import math

#Initilize the TKInter

root = Tk()

root.title('Plot 1')             # This is the title of the window

# **********************************************************************************************

# Define the Window sizes and draw 2 frames (plot and control windows) inside a large window

# **********************************************************************************************

#  Window size

window_width=int(800)

window_height=int(600)

#   Window - setup and draw

canvas = Canvas(root, width =window_width, height=window_height)

# ***************************************************************************

#   Window 1 - Large external frame

x_and_y_offsets=float(0.05)        # Space between window and external frame

x_left_top_large_frame=window_width * x_and_y_offsets

y_left_top_large_frame=window_height * x_and_y_offsets

x_right_bottom_large_frame=window_width - (window_width * x_and_y_offsets)

y_right_bottom_large_frame=window_height  -  (window_height * x_and_y_offsets)

#Draw the frame with a rectangle

canvas.create_rectangle(x_left_top_large_frame, y_left_top_large_frame,

x_right_bottom_large_frame, y_right_bottom_large_frame,

outline="blue", fill="grey", width='2')

# ***************************************************************************

#   Window 2 - Plot frame in the large window - A function is used to redraw this window to clean the area

#  Plot the "PLOT WINDOW" - Use this function to clean the picture in it - We will erase the curve and both Axes with labels

def draw_plot_window(x_left_offset, x_right_offset, y_top_bottom_offsets):

x_left_top_plot_frame=window_width * x_left_offset

y_left_top_plot_frame=window_height * y_top_bottom_offsets

x_right_bottom_plot_frame=window_width - (window_width * x_right_offset)

y_right_bottom_plot_frame=window_height  -  (window_height * y_top_bottom_offsets)

#Draw the frame with a rectangle

canvas.create_rectangle(x_left_top_plot_frame, y_left_top_plot_frame,

x_right_bottom_plot_frame, y_right_bottom_plot_frame,

outline="red", fill="white", width='2')

#  Define boundaries and call the plot window drawing function

x_left_plot_frame_offset=float(0.1)        # Space between window and plot frame

x_right_plot_frame_offset=float(0.3)        # Space between window and plot frame

y_top_bottom_plot_frame_offsets=float(0.1)        # Space between window and plot frame

# Draw the window with above boundaries by using the above function

draw_plot_window(x_left_plot_frame_offset, x_right_plot_frame_offset, y_top_bottom_plot_frame_offsets)

# ***************************************************************************

#   Window 3 - Control button frame in the window

x_left_control_offset=float(0.72)        # Space between window and plot frame

x_right_control_offset=float(0.08)        # Space between window and plot frame

y_top_bottom_control_offsets=float(0.1)        # Space between window and plot frame

x_left_top_control_frame=window_width * x_left_control_offset

y_left_top_control_frame=window_height * y_top_bottom_control_offsets

x_right_bottom_control_frame=window_width - (window_width * x_right_control_offset)

y_right_bottom_control_frame=window_height  -  (window_height * y_top_bottom_control_offsets)

(5/5)

## Related Questions

##### . The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

##### . Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

##### . The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

##### . Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

##### . The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme

Get Free Quote!

396 Experts Online