Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 67 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
0ac4e6f
Setting up GitHub Classroom Feedback
github-classroom[bot] Oct 23, 2023
e646ab7
add deadline
github-classroom[bot] Oct 23, 2023
177b7de
Sharing MATLAB Proiject attempt
WaqiMTC Nov 2, 2023
705c8a6
Rename README.md to legacyREADME.md
WaqiMTC Nov 3, 2023
fec3e71
Added rescale and database function
WaqiMTC Nov 3, 2023
d840c3c
Updated database to letters_database
WaqiMTC Nov 4, 2023
a7e923e
Create README.md
WaqiMTC Nov 4, 2023
8812a4b
Update on letter_database
fizahjamal Nov 4, 2023
11376e7
Update letters_database.m
fizahjamal Nov 4, 2023
7d5fded
Update letters_database.m
WaqiMTC Nov 5, 2023
5604da1
Added template file(s)
WaqiMTC Nov 5, 2023
0a62ad9
letters_database.m
NurulShafwana Nov 5, 2023
68d53b0
Updates and Additions to templates
WaqiMTC Nov 6, 2023
50b77e5
Updated .gitignore
WaqiMTC Nov 6, 2023
1caa8e0
letters
NurulShafwana Nov 6, 2023
e907c2f
Update on letters
fizahjamal Nov 6, 2023
a20123f
Banner picture
fizahjamal Nov 6, 2023
82597bd
Update ReadMe
fizahjamal Nov 6, 2023
cfece8d
letters
NurulShafwana Nov 6, 2023
10d6240
letters
NurulShafwana Nov 6, 2023
9cd424d
letters
NurulShafwana Nov 6, 2023
f09977b
File name change
WaqiMTC Nov 6, 2023
41c2e25
letters
NurulShafwana Nov 6, 2023
e7f5c5d
Update letter
fizahjamal Nov 6, 2023
0669dcf
letters updates
NurulShafwana Nov 6, 2023
3d376df
update letters
NurulShafwana Nov 6, 2023
f5d0469
Update letter
Ros-2646 Nov 6, 2023
a1a702a
Update letter
Ros-2646 Nov 6, 2023
9aa213a
Update letter
Ros-2646 Nov 6, 2023
be2a1af
Update letter
Ros-2646 Nov 6, 2023
bd166bd
Update letters
Ros-2646 Nov 6, 2023
b8c3c1c
letters update
NurulShafwana Nov 6, 2023
64b191d
Update ReadMe
fizahjamal Nov 6, 2023
d92c19d
Update letters
Ros-2646 Nov 6, 2023
b7e8f96
Update ReadMe
fizahjamal Nov 6, 2023
528e93c
Update ReadMe
fizahjamal Nov 6, 2023
15b5e24
letters added
NurulShafwana Nov 6, 2023
943ea4e
Update Readme
fizahjamal Nov 6, 2023
aca7311
Update letters
Ros-2646 Nov 6, 2023
e5a0ae8
Update letters
Ros-2646 Nov 6, 2023
aee4581
Update letter
Ros-2646 Nov 6, 2023
e9a2628
ThickColour.m
NurulShafwana Nov 6, 2023
1bb4678
readme
NurulShafwana Nov 6, 2023
fbffa74
readme
NurulShafwana Nov 6, 2023
bc49f68
Removed temp files
WaqiMTC Nov 6, 2023
46c13f7
Updated files
WaqiMTC Nov 6, 2023
9124931
Files
NurulShafwana Nov 6, 2023
2ebdcd0
files
NurulShafwana Nov 6, 2023
8a88097
Delete WhatsApp Image 2023-11-07 at 07.37.19.jpeg
NurulShafwana Nov 6, 2023
b7854e3
Delete WhatsApp Image 2023-11-07 at 07.37.20.jpeg
NurulShafwana Nov 6, 2023
96b08b6
Rescaling Letters
fizahjamal Nov 6, 2023
479ad6b
Merge branch 'main' of https://github.com/sm2302-aug23/grp-matlab-sup…
fizahjamal Nov 6, 2023
0c2fe30
readme
NurulShafwana Nov 6, 2023
e652b91
Update plotWord.m
WaqiMTC Nov 6, 2023
45dd648
Pacifico Font
fizahjamal Nov 7, 2023
5d13dc6
Update ReadMe
fizahjamal Nov 7, 2023
7d00c0b
Update letters
fizahjamal Nov 7, 2023
3704ca4
readme
NurulShafwana Nov 7, 2023
a31d5aa
readme
NurulShafwana Nov 7, 2023
ec473cc
readme
NurulShafwana Nov 7, 2023
acc2572
readme
NurulShafwana Nov 7, 2023
d4ac363
readme
NurulShafwana Nov 7, 2023
366b01b
readme
NurulShafwana Nov 7, 2023
30e2cd4
Update README.md
WaqiMTC Nov 7, 2023
ef17b1f
Update README.md
WaqiMTC Nov 7, 2023
fffb432
Updated database
WaqiMTC Nov 7, 2023
7e328ee
Merge branch 'main' of https://github.com/sm2302-aug23/grp-matlab-sup…
WaqiMTC Nov 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

*.asv
*.asv
*.asv
*.asv
2 changes: 2 additions & 0 deletions MATLABAssignment.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<MATLABProject xmlns="http://www.mathworks.com/MATLABProjectFile" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"/>
Binary file added PacificoFont.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 96 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,101 @@
# Group Assignment (MATLAB)
# Spline Your Name (by SuperfectAgoras)
![superfectagoras banner](https://github.com/sm2302-aug23/grp-matlab-superfectagoras/blob/main/SM.png)

This repository contains instructions for SM-2302 MATLAB group assignment.
## Task 1: Readying the letters
### 1.1: Observations on cursive fonts and handwriting
During brainstorming, we thought of using the Pacifico Font. But after
several more discussion, we decided to use most of Waqi's sister cursive
font and few from Pacifico Font as reference to the fonts that we plot
using spline. Below is how the cursive font looks like for both uppercase
and lowercase letters of the two fonts;
![lowercase reference](https://github.com/sm2302-aug23/grp-matlab-superfectagoras/blob/main/lowercase%20reference.jpeg)
![uppercase reference](https://github.com/sm2302-aug23/grp-matlab-superfectagoras/blob/main/uppercase%20reference.jpeg)
![PacificoFont](https://github.com/sm2302-aug23/grp-matlab-superfectagoras/blob/main/PacificoFont.jpg)

The assignment is due on **Tuesday, 7 November 2023 at 12:00 PM**.
Here's how some of the plots we made looks like;
(add photos of the letters we made)

Understand the sample code given in the [`Group2-2023.pdf`](Group2-2023.pdf) document, and read the instructions carefully.
### 1.2: Observation on splines
The start point of each curve plot of letters looks a bit sharp while the
end points are more curvy that it would go beyond the point.

Read [`notes.md`](notes.md) for some advice on good MATLAB programming style and marking scheme.
To make the letter point sharper and less curved for sharp turns, we add
additional points. Depending on each additional point we plot, it will
creates a loop effect. The more closely two points are spaced(1 for the
initial point and 1 for the additional point), the sharper the curves seem.

For back-and-forths, imagine drawing on-going lines between points and when
we connect them, the spline shifts back and forth between these points.
It's like a zigzag motion as the spline links them together.

### 1.3: Applying the observations
We standardized the dimensions of lowercase letters to 2by2 and uppercase
letters to 4by4. This was done to facilitate clear distinction between
letter sizes.

We determine the x and y coordinates for each point by envisioning the
anticipated appearance of the plot. Some of us even utilized graph paper to
visually identify the points for plotting each letter more conveniently.

To enhance the sharp corners, an repeated point was incorporated to
create a loop effect, given for the inherent curve nature of spline.

For lowercase letters, mostly begin at x=0 and end at x=2, while uppercase
letters end at x=4. This ensures proper alignment of letters on a line when
constructing words and consistent starting and ending points for most
letters.

## Task 2: Creating letters_database.m
To store the coordinates of the letters, we have decided to use a dictionary! This dictionary is put inside the `letters_database.m` function.
The input is the letter that we want to find the coordinates for.
The output will be both the x and y coordinates of the letter.
- The file is [letters_database.m](letters_database.m) for reference

To use a dictionary, we need to have a key and a value array. How it works is that a key is paired with a value, and the pairing is depending on
their index on their respective arrays.

Our keys are the letters that we will be accepting, being both uppercase and lowercase alphabets. We had to store them inside a cell because
if we use an array instead, the letters will be joined together, which will not be ideal for use as keys for dictionaries.

Our values will be the x and y coordinates for the letter. To store both of them inside an index, we have to put the pair inside another cell.
The first array in the inner cell will be the x coordinates, the second array in the inner cell will be the y coordinates.

## Task 3: Creating plotWord.m
- Breaking strings into chunks of words
- We split strings using the split() function with the delimiter as '//'
- This is so that we can make more aesthetically pleasing structure in our plot sentences.
- We also run this through strip() to remove any whitespaces at the start and end of each chunk of lines
- The file is [plotWord.m](plotWord.m) for reference

## Task 4: Making words/sentences (continuation of Task 3)
- The structure of the loops
- First, we iterate through the chunks of lines we got from Task 3
- And then for each chunk of line, we iterate through the characters

- Translating the coordinates to the right
- We find the max value inside the current letter's x coordinates first
- Then we compare with `endpoint` variable. If max value is bigger than `endpoint`, then replace `endpoint` with max value.
- This is used for shifting all coordinates of the next letter by the value of endpoint.
- This will ensure that the very first point of the next letter will start at the very end of the current letter.
- If the letter happens to be space `(' ')`, we will add 2 to `endpoint` to create space without checking letters_database().

- Breaking lines by shifting coordinates to the top/bottom
- First, we count the number of lines that we got from Task 3, store it into `lines`
- Then, we use `y = y + 8 * (lines - 1)` so the first chunk of lines will be at the very top.
- We reduce `lines` by one every time we iterate through the first loop.

- Adjusting the axes to clearly show the plot
- We check the max and min of x and y coordinates of the whole plot
- Compare them with `max_x`, `max_y`, `min_x`, `min_y` variables.
- If max value of x surpasses `max_x`, replace `max_x` with that max value
- If max value of y surpasses `max_y`, replace `max_y` with that max value
- If min value of x surpasses `min_x`, replace `min_x` with that min value
- If min value of y surpasses `min_y`, replace `min_y` with that min value
- Use these variables for axis() to adjust the plot axes accordingly.

## Contributors

- Waqi :computer: :sparkles:
- Ros :octocat: :wilted_flower:
- Fizah :partly_sunny: :milky_way:
- Wana :books: :pill:
Binary file added SM.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions ThickColour.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
% Sample coordinates
% Change x y coordinates depends on letter used
x_coord = [0.0 1.0 2.0 3.0 4.0 3.4 4.4];
y_coord = [4.0 0.2 2.2 0.2 4.0 3.0 3.0];
% x = [];
% y = [];

%% Create a spline curve
% Using linspace to create range values between 2 endpoints 1-100
t = linspace(1, length(x_coord), 100);
% Interpolating smooth curve
x_spline = spline(1:length(x_coord), x_coord, t);
y_spline = spline(1:length(y_coord), y_coord, t);

% Plotting the spline curve
% Can vary line width and colours
plot(x_spline, y_spline, 'LineWidth', 100, 'Color', 'blue');

% Add labels and title if needed
xlabel('X-axis');
ylabel('Y-axis');
title('Customized Spline Coordinates Plot');
11 changes: 11 additions & 0 deletions legacyREADME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-24ddc0f5d75046c5622901739e7c5dd533143b0c8e959d652212380cedb1ea36.svg)](https://classroom.github.com/a/i8q0vJZ5)
# Group Assignment (MATLAB)

This repository contains instructions for SM-2302 MATLAB group assignment.

The assignment is due on **Tuesday, 7 November 2023 at 12:00 PM**.

Understand the sample code given in the [`Group2-2023.pdf`](Group2-2023.pdf) document, and read the instructions carefully.

Read [`notes.md`](notes.md) for some advice on good MATLAB programming style and marking scheme.

Loading