easel Manager Danielle Crosswell dac2182 Language Guru Tyrus Cukavac thc2125 System Architect Yuan-Chao Chou yc3211 Tester Xiaofei Chen xc2364

Similar documents
easel LANGUAGE REFERENCE MANUAL

egrapher Language Reference Manual

The Warhol Language Reference Manual

blur (.blr) Project Proposal Dexter Callender dec2148 Tim Goodwin tlg2132 Daniel Hong sh3266 Melissa Kaufman-Gomez mhk2149

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

Lexical Considerations

Crayon (.cry) Language Reference Manual. Naman Agrawal (na2603) Vaidehi Dalmia (vd2302) Ganesh Ravichandran (gr2483) David Smart (ds3361)

SECTION II: LANGUAGE BASICS

Lexical Considerations

(SSOL) Simple Shape Oriented Language

The Arithmetic Operators. Unary Operators. Relational Operators. Examples of use of ++ and

The Arithmetic Operators

SSOL Language Reference Manual

9 Using Equation Networks

1 Lexical Considerations

Chapter 2 Working with Data Types and Operators

Mirage. Language Reference Manual. Image drawn using Mirage 1.1. Columbia University COMS W4115 Programming Languages and Translators Fall 2006

Twister: Language Reference Manual

CSc 372. Comparative Programming Languages. 4 : Haskell Basics. Department of Computer Science University of Arizona

Lecture 19: Functions, Types and Data Structures in Haskell

CSc 372 Comparative Programming Languages. 4 : Haskell Basics

FRAC: Language Reference Manual

CSc 520. Principles of Programming Languages 11: Haskell Basics

C++ Programming: From Problem Analysis to Program Design, Third Edition

Introduction to Programming Using Java (98-388)

CMAT Language - Language Reference Manual COMS 4115

Middle School Mathematics Trimester 2 Subject Overview

Language Reference Manual simplicity

GOLD Language Reference Manual

L-System Fractal Generator: Language Reference Manual

pixelman Pixel Manipulation Language Anthony Chan tc2665 Teresa Choe tc2716 Gabriel Lucas Kramer-Garcia glk2110 Brian Tsau bt2420

LASER s Level 2 Maths Course - Summary

COMP1730/COMP6730 Programming for Scientists. Data: Values, types and expressions.

Using Arrays and Vectors to Make Graphs In Mathcad Charles Nippert

JME Language Reference Manual

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

ENGINEERING 1020 Introduction to Computer Programming M A Y 2 6, R E Z A S H A H I D I

GraphQuil Language Reference Manual COMS W4115

Language Reference Manual

Principles of Programming Languages

Your first C++ program

PieNum Language Reference Manual

CIS133J. Working with Numbers in Java

The MatriCs. Reloaded. A linear algebra-specific language for the budding C enthusiast. Short name: MaC Extension:.neo

Chapter 1 Introduction to MATLAB

Honors Computer Science Python Mr. Clausen Program 7A, 7B

NumNum Language Proposal 1. COMS 4115: NumNum Language Proposal. Programming Languages and Translators. COMS 4115 W Section 1. Prof.

Chapter 4: Basic C Operators

Project Compiler. CS031 TA Help Session November 28, 2011

text++ Joi Anderson - jna2123 // Manager + Tester Klarizsa Padilla - ksp2127 // Language Guru Maria Javier - mj2729 // System Architect + Tester

PROGRAMMING IN C AND C++:

CMPSCI 119 Fall 2018 Wednesday, November 14, 2018 Midterm #2 Solution Key Professor William T. Verts

1. INTRODUCTION 4 2. LANGUAGE TUTORIAL INSTALLING DEPENDENCIES AND RUNNING THE COMPILER BASIC PROGRAM 4

Basic C Programming (2) Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

MATLAB Constants, Variables & Expression. 9/12/2015 By: Nafees Ahmed

Decaf Language Reference

1001ICT Introduction To Programming Lecture Notes

Client-Side Web Technologies. JavaScript Part I

EE 301 Signals & Systems I MATLAB Tutorial with Questions

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements

Lesson 10. Homework Problem Set Sample Solutions. then Print True else Print False End if. False False True False False False

Lecture Set 4: More About Methods and More About Operators

Introduction. Following are the types of operators: Unary requires a single operand Binary requires two operands Ternary requires three operands

The SPL Programming Language Reference Manual

Operators and Expressions

The pixelman Language Reference Manual. Anthony Chan, Teresa Choe, Gabriel Kramer-Garcia, Brian Tsau

VARIABLES AND TYPES CITS1001

Lesson #3. Variables, Operators, and Expressions. 3. Variables, Operators and Expressions - Copyright Denis Hamelin - Ryerson University

NumPy quick reference

Trigonometry Notes. Cartesian coordinates. Trigonometry lives on graph paper: Trig Notes

CHIL CSS HTML Integrated Language

General Syntax. Operators. Variables. Arithmetic. Comparison. Assignment. Boolean. Types. Syntax int i; float j = 1.35; int k = (int) j;

Control Structures. Lecture 4 COP 3014 Fall September 18, 2017

Manipulate expressions containing surds and rationalise denominators (A*) Able to simplify surds (A)

Fundamentals of Programming

CSc 225 Algorithms and Data Structures I Algorithm Analysis

Scheme Quick Reference

Programming in C++ 5. Integral data types

On a 64-bit CPU. Size/Range vary by CPU model and Word size.

Defining Functions. CSc 372. Comparative Programming Languages. 5 : Haskell Function Definitions. Department of Computer Science University of Arizona

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

QUIZ. 1. Explain the meaning of the angle brackets in the declaration of v below:

Intermediate Code Generation

Chapter 3: Operators, Expressions and Type Conversion

Data dependent execution order data dependent control flow

Introduction to Applied and Pre-calculus Mathematics (2008) Correlation Chart - Grade 10 Introduction to Applied and Pre-Calculus Mathematics 2009

Final exam. Final exam will be 12 problems, drop any 2. Cumulative up to and including week 14 (emphasis on weeks 9-14: classes & pointers)

Python Numbers. Learning Outcomes 9/19/2012. CMSC 201 Fall 2012 Instructor: John Park Lecture Section 01 Discussion Sections 02-08, 16, 17

Computer Graphics : Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling

Decaf Language Reference Manual

+ Inheritance. Sometimes we need to create new more specialized types that are similar to types we have already created.

List of NEW Maths content

blur Melissa Kaufman-Gomez Team Leader Timothy Goodwin System Architect Dexter Callender Language Guru Daniel Hong Test Wizard

I/A Series Software Spreadsheet

Arithmetic and Logic Blocks

Methods (Deitel chapter 6)

Two Types of Types. Primitive Types in Java. Using Primitive Variables. Class #07: Java Primitives. Integer types.

Methods (Deitel chapter 6)

Simple Java Reference

Methods CSC 121 Fall 2014 Howard Rosenthal

Transcription:

easel Manager Danielle Crosswell dac2182 Language Guru Tyrus Cukavac thc2125 System Architect Yuan-Chao Chou yc3211 Tester Xiaofei Chen xc2364

INTRODUCTION & MOTIVATION To most people mathematics is that pesky subject which you ll never quite understand; however, there s another side to math. Mathematics can be seen as an art form, like drawing or painting. Using easel, we d like to do just that. Our ultimate goal of this language is to create art using math. Being able to visualize mathematical formulas has multiple uses. The first is simply to create beautiful images with just a few lines of code. This language also provides an opportunity to view formulas in forms other than just the normal bar or line graph. easel will allow its users to visualize sets of data in ways that they haven t been viewed before. The user will be able to view their results in a more subjective manner, bringing creative possibilities to mathematics. easel also will enable the user to take functions and map them into an output that can be printed in 2D or 3D. Additionally, easel can be used to provide visualizations of projects such as mapping the internet, which involves a lot of data so it requires a way of mapping all of the data in an aesthetically pleasing manner. Finally, easel can be used to create fractals, which can only be drawn by computers. By combining the ability to draw interesting graphics and having the computational power of a computer, easel can effectively depict fractals. LANGUAGE DESCRIPTION The primary purpose of our language is to provide programmers a means of expressing data and functions as visual representations. As a result, the language is capable of performing both basic and advanced mathematical expressions as simple operators, without the use of additional libraries (for example, trigonometric and logarithmic functions). Primitive data types consist of some syntactic sugar to make the creation of images a central feature of the program. canvas and pix are data types representing the drawing canvas and pixel qualities, respectively. Vectors are a unique data type that can be used to assist in plotting points of data (similar to a graph). Additionally, because of the nature and role of functions in the creation of mathematically based images, functions are considered first-class objects. They can be passed as parameters, returned as values, and declared anonymously in pursuit of those objectives. In order to allow for robust execution of languages, basic timer functionality has also been baked into the language, allowing a programmer to define when given functions should execute. 2

BASIC DATA TYPES TYPE CONTAINS SYNTAX NOTES bool boolean value bool VAR = VALUE; value stored as 0 or 1 and can be represented by "true" or "false" keywords int numeric value int VAR = VALUE; can be input using either hex or decimal notation float floating point float VAR = VALUE; can be input using decimal string numeric value string value (array of characters) string VAR = STRING- VALUE; pix numeric value pix VAR =24-BIT-VALUE; pix VAR [red/green/blue]=8- BIT-VALUE; notation generally only used to specify filepaths can be input using hex, decimal, or specialized array notation PIX DATA TYPE A pix essentially stores a color value from 0-16777216 (i.e. 6 hex values) in order to define colors for a specific pixel. pix can use either standard integer/hex notation, or can be accessed similarly to a map (red being a designated keyword that extrapolates the value of red from the pixel's overall numerical value). For example: pix mypix[red]=#ff Pixels can be thought of as a combination of char and string types in other languages: char because each pixel is a single numerical value, string because syntactically the pixel can be altered one color at a time. A pixel can be defined by passing it a list of the form {#red, #green, #blue} Example: pix redpix = #ff0000; pix redpix2 = 16711680; pix redpix3 = {255, 0, 0}; pix redpix4[red] = 255; /* This would set the pixel to have a maximum red value. Green and blue would automatically be set to 0 and the pixel integer value would equal #ff0000 */ 3

COMPOUND DATA TYPES TYPE CONTAINS SYNTAX NOTES array a collection of primitive elements PRIMITIVE_TYPE VAR[ITEMS]; each element within the array must be defined separately matrix a collection of arrays PRIMITIVE_TYPE VAR [ITEMS][ITEMS] tuple a collection of elements PRIMITIVE TYPE VAR = {ITEM_1,ITEM_2,.. items can be added or removed from tuples using special canvas vector syntactic sugar; essentially a matrix of pixels. syntactic sugar; a 2-tuple with ordered pairs of coordinates.,item_n}; canvas VAR [SIZE_X][SIZE_Y]; vec VAR = {{0,1},{1,2}}; function both rows and columns of a canvas element are 2x+1 of the user provided size and begin from -SIZE to +SIZE (to approximate a cartesian graph with a center index of (0,0)) two-tuples can be passed as values as well as constants. Negative indexing is allowed to access array and matrix elements, by counting from the tail. For example, given an array a of size 10, a[-8] is equivalent to a[10-8] or a[2]. Lists, arrays, matrices, and canvases have the property size which indicates the length of the list/sublist/array/matrix. Example: canvas c[10][20]; canvas[2].size = 20 MATHEMATICAL OPERATORS OPERATOR MEANING UNARY SYNTAX + Addition ++ int a = 5+5; - Subtraction -- int a = 5-5; / Division // int a = 5/5; * Multiplicati ** int a = 5*5; on % Modulus %% int a=5%5; ^ Exponentiati ^^ int a=5^5; on ~ Sine float a=~5; ~~ Cosine float a=~~5; @ Tangent float a=@5; Logarithm float a=5 5; /* base 5, log 5 */ float b= 5; /* defaults to base 10 */ $ Root float a=3$64; /* cube root of 64 */ float b=$16; /*defaults to square root */ 4

OTHER OPERATORS OPERATOR MEANING = assigns a value to a variable < less than > greater than == equivalent <= less than or equal to >= greater than or equal to!= not equivalent to && logical AND logical OR! NOT. access operator (accesses value of KEY in OBJECT.KEY) /*... */ commenting CONTROL FLOW SYNTAX if (EXPR) {STATEMENT} else {STATEMENT2} for (STATEMENT1; EXPRESSION; STATEMENT2) { STATEMENT3;} do { STATEMENT; } while (EXPRESSION); while (EXPRESSION) { STATEMENT; } MEANING if EXPR evaluates to true execute STATEMENT otherwise evaluate STATEMENT2 repeat STATEMENT3 until EXPRESSION evaluates to false repeat STATEMENT until EXPRESSION evaluates to false repeat STATEMENT until EXPRESSION evaluates to false FUNCTIONS The basic grouping of statements in easel - every body of code is considered a function. Functions can be passed as arguments to other functions and can be called recursively. function RETURN_TYPE NAME(PARAM1, PARAM2) { STATEMENTS } Functions as a parameter: call(param1, function RETURN_TYPE(PARAM1,..., PARAMN) {STATEMENTS}) Functions as a return value: function RETURN_TYPE FUNCTION1 (VAR) { return function RETURN_TYPE (PARAMS){ STATEMENT WITH VAR; } } 5

SPECIAL FUNCTIONS Function Call Description Notes void draw(int x, int y) draws a given canvas to the screen can only be called by canvas elements; integers represent the top corner of the image; non-blocking function - the canvas will remain of the screen as following void drawout (int overwrite_time, string file_path) saves file to given filepath statements execute can only be called by canvas elements; if the gif file already exists and integer is 0 or higher, the function will draw the canvas as an additional frame into the gif, placed at the time period of the given int canvas view (string file_path) void graph (function black) void graph (function shape, function color) void graph (function red, function green, function blue) void execinterval (int t, function f) void execafter (int t, function f) scans in a given gif file and returns a canvas element overloaded function graphs a given function onto a canvas function that executes a given function over an interval t function that executes a given function after a period of time t can be called by canvas elements; accepts up to 3 functions as arguments as well as an int value representing the axis to map the function to; default color to map to is black, can specify with other functions the colors of each pixel integer value represents an integer in milliseconds; allows for basic animation integer value represents a time period in milliseconds 6

SAMPLE CODE Draws the Mandelbrot set displayed on the cover page: 7