# Can we plot a function which includes objects based on points?

sanjyutu shared this question 1 year ago

I wanted to plot a dot product of two-dimensional vectors. I have created vector v and I want the dot product of every position vector on xy plane.

So I tried this. But the syntax was invalid.

`z = Dot[v, Vector[(x, y)]]`
Then I found out a valid syntax.

```z = x(v) * x + y(v) * y
```

So my problem was solved, but I have a feeling that there might be a case which is hard to write without using object. And I want to know if there is a way to write a function which create objects based on point.

Best regards, for defining a function you can use only functions on x,y , not commands

ie: you can define f(x) and g(x) then (f+g+abs(f-g))/2 is max(f,g) but max is a command (max(number,number)) so you can not define h(x)=max(f(x),g(x))

you can use values of objects in functions like x(v) in your function, more, you can define f(x,y)=x(v)*x+y(v)*y then u=(3,4) and ask for f(u)

you can try your 'definitions' in CAS window; the syntax is more similar you want 1

for defining a function you can use only functions on x,y , not commands

ie: you can define f(x) and g(x) then (f+g+abs(f-g))/2 is max(f,g) but max is a command (max(number,number)) so you can not define h(x)=max(f(x),g(x))

you can use values of objects in functions like x(v) in your function, more, you can define f(x,y)=x(v)*x+y(v)*y then u=(3,4) and ask for f(u)

you can try your 'definitions' in CAS window; the syntax is more similar you want 1

Thank you for clear explanation about the limitation of commands. 