Creating Christmas Tree using [Matlab] [closed] - xcode
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I am looking for a Matlab code to create a Christmas tree
maybe some Triangles above each other and a rectangle with some circles as decoration .
Nothing simpler than that, just use fill and annotation
figure;
hold on;
axis off;
% Strunk
fill([3,3,4,4],[0,1,1,0],[139,69,19]./255,'LineStyle','none')
% Tree
x = [1,6,5,5.5,4.5,5,3.5,2,2.5,1.5,2,1]
y = [1,1,3,3,5,5,8,5,5,3,3,1]
fill(x,y,'g','LineStyle','none')
% Decoration
annotation('ellipse',[0.3,0.5,0.05,0.05],'Color','red','FaceColor','red')
annotation('ellipse',[0.6,0.3,0.05,0.05],'Color','red','FaceColor','red')
annotation('ellipse',[0.55,0.6,0.05,0.05],'Color','red','FaceColor','red')
Related
Cube Scramble Algorithm [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago. Improve this question I need a Rubiks cube generator for my project. I searched a lot but I only found websites that provide me a scramble but do not provided a method/function to do so. Is there a way for me to make my own or is an algorithm already available. Thanks
Find yourself a way how to represent the cube (each side and each cell of a side) Determine, how your representation changes when rotating a horizontal section once clockwise and how your representation changes when rotating a vertical section once clockwise. n times, randomly select a horizontal or vertical section and rotate it once clockwise.
How to combine two binary image? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 years ago. Improve this question I have a final project in which I have to combine two images from optic disk segmentation and optic cup segmentation on binary images. I can't combine both images. i wish anyone can help me. thankyou
If the images are binary, you may want to take the logical AND to get the pixels that are white in both of them. im3=im1 & im2;
Assuming that the two images have the same size and the values are in {0,1}, I think result = image1 .* image2; would be the most natural choice, yielding a result like this:
how to calculate the diameter of an ellipse? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 years ago. Improve this question I have a work to calculate the diameter vertical and horizontal of an ellipse to determine the value of the cup to disk ratio of glaucoma. from the journal was im read, they are using fit ellipse methode. How might I do that?
You can try to fit an ellipse using the Hough Transform. But you can also find what you want using: PCA => it will give you the main and secondary axises. Moments
cocos2d. Matrix calculations? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 9 years ago. Improve this question I draw a graphical primitives using functions ccDraw... and I need to calc for example a scale and transition using 3x3 matrices. How to solve this issue in cocos2d? I can't simply use sprites/nodes because all the calculated points belong to the same object. Is it possible without converting CGPoint->matrix->CGPoint?
It sounds like you are trying to do scale/rotation on the CGPoints. You can do this using CGAffineTransform functions and structure that are part of Quartz 2D. See these references: Apple's Documents. A single example of rotating a rectangle formed by four points. SO Example(s). Was this helpful?
How can I perform Collision Detection on rotated rectangles? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 8 years ago. Improve this question Okay, I'm trying to write a program that could tell me if any points in a 30x100 rectangle rotated to 140 degrees are inside another 30x100 rectangle rotated to 200 degrees. Honestly, I don't even know where to start. I thought about re-rotating them before doing normal calculations, but than they still wouldn't match up. How can I do this?