Draw the letters A and B of English alphabet using multiple Bezier curves.
Solution:
Note: I am writing the code in python. Please make sure about proper indentation.
def make_bezier(xys): # xys should be a sequence of 2-tuples (Bezier control points) n=len(xys) combinations=pascal_row(n-1) def bezier(ts): # This uses basic general formula for bezier curves # http://en.wikipedia.org/wiki/B%C3%A9zier_curve#Generalization result=[] for t in ts: tpowers=(t**i for i in range(n)) upowers=reversed([(1-t)**i for i in range(n)]) coefs=[c*a*b for c,a,b in zip(combinations,tpowers,upowers)] result.append( tuple(sum([coef*p for coef,p in zip(coefs,ps)]) for ps in zip(*xys))) return result return bezier def pascal_row(n): # This returns the nth row of Pascal's Triangle result=[1] x,numerator=1,n for denominator in range(1,n//2+1): # print(numerator,denominator,x) x*=numerator x/=denominator result.append(x) numerator-=1 if n&1==0: # n is even result.extend(reversed(result[:-1])) else: result.extend(reversed(result)) return result import Image import ImageDraw if __name__=='__main__': im = Image.new('RGBA', (100, 100), (0, 0, 0, 0)) draw = ImageDraw.Draw(im) ts=[t/100.0 for t in range(101)] xys=[(0,100),(25,50),(50,0)] bezier=make_bezier(xys) points=bezier(ts) xys=[(50,0),(75,50),(100,100)] bezier=make_bezier(xys) points.extend(bezier(ts)) xys=[(100,100),(85,75),(75,50)] bezier=make_bezier(xys) points.extend(bezier(ts)) xys=[(75,50),(50,50),(25,50)] bezier=make_bezier(xys) points.extend(bezier(ts)) draw.polygon(points,fill=None,outline='red') im.save('LetterA.png') #letter B im = Image.new('RGBA', (100, 100), (0, 0, 0, 0)) draw = ImageDraw.Draw(im) ts=[t/100.0 for t in range(101)] xys=[(0,0),(0,50),(0,100)] bezier=make_bezier(xys) points=bezier(ts) xys=[(0,100),(100,100),(0,50)] bezier=make_bezier(xys) points.extend(bezier(ts)) draw.polygon(points,fill=None,outline='red') im.save('LetterB.png')
Draw the letters A and B of English alphabet using multiple Bezier curves.
13) In how many ways can 26 letters of English alphabet be arranged so that none of the pattern net, byte, or dog occurs?
A password consists of 4 letters among 26 lower-case English alphabet letters and 10 digits: 0,1,...,9. (i) How many different passwords that contain at least one digit can be formed? (ii) How many different passwords that contain at least one digit and at least one letter can be formed?
Some laser printers use Bezier curves to represent letters and symbols. Experiment with different sets of control points until you find a Bezier curve that gives a good representation of the letter C. Find 4 sets of points (P0, P1, P2, P3) that when plugged into x= x0(1−u)^3 +3(x1)u(1−u)^2 + 3(x2)u^2(1−u) + (x3)u^3 y= y0(1−u)^3 + 3(y1)u(1−u)^2 + 3(y2)u^2(1−u) + (y3)u^3 Create a C shape
How many different passwords of size 6 can be formed using English alphabet characters if the first letter must be a capital letter and the remaining letters must be lower case? a) 26 * C(25, 5) b) P(26, 5) c) 26 * P(26, 5) d) 26 * C(26, 5) e) P(26, 6)
1. (5) Suppose we have a set of small wooden blocks showing the 26 letters of the English alphabet, one letter per block. (Think of Scrabble tiles.) Our set includes 10 copies of each letter. We place them into a bag and draw out one block at a time. (a) If we line up the letters on a rack as we draw them, how different ways coukl we fill a rack of 5 letters? (b) Now suppose we just toss...
choose 4 letters in the alphabet using simple and systematic random sampling. explain how you did it.
Using twotwo of the letters of the alphabet, how many fourfour-letter codes can we form if we are allowed to use the same letter more than once?
If you have all the letters of the alphabet spread on a table. How many different 4 letter strings can be formed with using the alphabet if the first letter must be a vowel?
How many 10-letter “words” using the 26-letter alphabet either begin or end with a vowel? Draw and use a Venn diagram to support your solution. Be sure to clearly identify your sets. (Letters may be repeated in this problem)
Question 14 5 pts Imagine your alphabet is literally the letters in GO JACKETS. Let's ignore the space. So = {G, 0,J,A,C,K, E,T, S}. Notice that alphabet has 9 letters. If you cannot use any letter more than once, how many unique strings are there that are 5 letters long using letters from our alphabet, Remember we cannot reuse a letter in the same 5 letter string, so "SOOTS" would be illegal. C19,4) 95 9!/4! C19,5)