love maths

love maths

85 Reputation

5 Badges

11 years, 285 days

MaplePrimes Activity


These are questions asked by love maths

so would anybody know how to write a function that checks whether two line segments intersect?  each line segment is given a list [[a,b],[x,y]] , of 2 lists with 2 numbers in each.   

it should return  "True" if ∃s,t  [0,t] : sa+(1-s)b =tx+(1-t)y ,  else"False"

 I haven't a clue so any help would be appreciated,

thanks in advance.

okay so i have to write a maple function that decides wheter a line given by a vector that spans it intersects a triangle with given vertices. 

an example of what it should look it is 

ISC([[0,0],[10,10],[10,10]],[2,1]) returns true

ISC([[0,0],[10,10],[10,0]],[-2,1]) returns false

 

thanks in advance.  i'm just having severe problems with writing functions and what not as you can tell. anyway, Thanks!!

okay so the question i have to answer is "write a maple function that computes the area of a triangle in the plane from the coordinates of the vertices"  

ive gotten this far 

 

with(geometry);

triangle(ABC, [point(A, 0, 0), point(B, 2, 0), point(C, 1, 3)]);

area(ABC);    3

 

but how can i write so when you type say AA([[0,0],[10,10],[10,0]])  it returns  50?  (AA being the function name)

 

Thanks in advance to whoever helps.

we were given three questions to do, i got the other two ones out grand but ive been trying to do this for hours and i still don't get it.   it is 

Write a function that produces the power set of a given nite set M, i.e. the set of all subsets.

Thusyour function has

Argument: a finite set M,

Returnvalue: the set of all subsets of M.

Examples: If PP is the procedure,PP({}) returns {{}},PP({a}) returns {{},{a}},PP({a,b}) returns {{},{a},{b},{a,b}},PP({a,b,c}) returns {{},{a},{b},{c},{a,b},{a,c},{b,c},{a,b,c}},PP({a,b,c,d}) returns{{},{a},{b},{c},{d},{a,b},{a,c},{a,d},{b,c},{b,d},{c,d},{a,b,c},{a,b,d},{a,c,d},{b,c,d},{a,b,c,d}}.

 

you will be rewarded with a lifetime supply of grattitude if you can help me out! thanks.

1 2 3 Page 3 of 3